tgstation-server 6.17.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Tgstation.Server.Host.Jobs.IJobManager Interface Reference

Manages the runtime of Jobs. More...

Inheritance diagram for Tgstation.Server.Host.Jobs.IJobManager:
Inheritance graph
[legend]

Public Member Functions

void SetJobProgress (JobResponse apiResponse)
 Set the JobResponse.Progress and JobResponse.Stage for a given apiResponse .
 
ValueTask RegisterOperation (Job job, JobEntrypoint operation, CancellationToken cancellationToken)
 Registers a given Job and begins running it.
 
ValueTask< bool?> WaitForJobCompletion (Job job, User? canceller, CancellationToken jobCancellationToken, CancellationToken cancellationToken)
 Wait for a given job to complete.
 
ValueTask< Job?> CancelJob (Job job, User? user, bool blocking, CancellationToken cancellationToken)
 Cancels a give job .
 

Detailed Description

Manages the runtime of Jobs.

Definition at line 12 of file IJobManager.cs.

Member Function Documentation

◆ CancelJob()

ValueTask< Job?> Tgstation.Server.Host.Jobs.IJobManager.CancelJob ( Job  job,
User user,
bool  blocking,
CancellationToken  cancellationToken 
)

Cancels a give job .

Parameters
jobThe Job to cancel.
userThe User who cancelled the job . If null the TGS user will be used.
blockingIf the operation should wait until the job exits before completing.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the updated job if it was cancelled, null if it couldn't be found.

Implemented in Tgstation.Server.Host.Jobs.JobService.

Referenced by Tgstation.Server.Host.Controllers.JobController.Delete(), Tgstation.Server.Host.Components.InstanceManager.OfflineInstance(), and Tgstation.Server.Host.Controllers.InstanceController.Update().

Here is the caller graph for this function:

◆ RegisterOperation()

ValueTask Tgstation.Server.Host.Jobs.IJobManager.RegisterOperation ( Job  job,
JobEntrypoint  operation,
CancellationToken  cancellationToken 
)

◆ SetJobProgress()

void Tgstation.Server.Host.Jobs.IJobManager.SetJobProgress ( JobResponse  apiResponse)

Set the JobResponse.Progress and JobResponse.Stage for a given apiResponse .

Parameters
apiResponseThe JobResponse to update.

Implemented in Tgstation.Server.Host.Jobs.JobService.

Referenced by Tgstation.Server.Host.Controllers.JobController.AddJobProgressResponseTransformer(), and Tgstation.Server.Host.Controllers.JobController.GetId().

Here is the caller graph for this function:

◆ WaitForJobCompletion()

ValueTask< bool?> Tgstation.Server.Host.Jobs.IJobManager.WaitForJobCompletion ( Job  job,
User canceller,
CancellationToken  jobCancellationToken,
CancellationToken  cancellationToken 
)

Wait for a given job to complete.

Parameters
jobThe Job to wait for.
cancellerThe User to cancel the job . If null the TGS user will be used.
jobCancellationTokenA CancellationToken that will cancel the job .
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> representing the Job. Results in true if the Job completed without errors, false if errors occurred, or null if the job isn't registered.

Implemented in Tgstation.Server.Host.Jobs.JobService.

Referenced by Tgstation.Server.Host.Components.Instance.AutoUpdateAction(), and Tgstation.Server.Host.Components.Chat.Providers.Provider.ReconnectionLoop().

Here is the caller graph for this function:

The documentation for this interface was generated from the following file: