tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
IJobManager.cs
Go to the documentation of this file.
1using System.Threading;
2using System.Threading.Tasks;
3
6
8{
12 public interface IJobManager
13 {
18 void SetJobProgress(JobResponse apiResponse);
19
27 ValueTask RegisterOperation(Job job, JobEntrypoint operation, CancellationToken cancellationToken);
28
37 ValueTask<bool?> WaitForJobCompletion(Job job, User? canceller, CancellationToken jobCancellationToken, CancellationToken cancellationToken);
38
47 ValueTask<Job?> CancelJob(Job job, User? user, bool blocking, CancellationToken cancellationToken);
48 }
49}
Represents a long running job on the server. Model is read-only, updates attempt to cancel the job.
Definition JobResponse.cs:7
Manages the runtime of Jobs.
void SetJobProgress(JobResponse apiResponse)
Set the JobResponse.Progress and JobResponse.Stage for a given apiResponse .
ValueTask< Job?> CancelJob(Job job, User? user, bool blocking, CancellationToken cancellationToken)
Cancels a give job .
ValueTask< bool?> WaitForJobCompletion(Job job, User? canceller, CancellationToken jobCancellationToken, CancellationToken cancellationToken)
Wait for a given job to complete.
ValueTask RegisterOperation(Job job, JobEntrypoint operation, CancellationToken cancellationToken)
Registers a given Job and begins running it.
delegate ValueTask JobEntrypoint(IInstanceCore? instance, IDatabaseContextFactory databaseContextFactory, Job job, JobProgressReporter progressReporter, CancellationToken cancellationToken)
Entrypoint for running a given job.