Class JobScheduler
Compute job scheduler.
Inheritance
Implements
Namespace: DNVGL.One.Compute.Scheduling.Scheduler
Assembly: DNVGL.One.Compute.Scheduling.dll
Syntax
public class JobScheduler : IJobScheduler
Constructors
View SourceJobScheduler(OrchestrationEnvironment)
Initializes a new instance of the JobScheduler class.
Declaration
public JobScheduler(OrchestrationEnvironment orchestrationEnvironment)
Parameters
Type | Name | Description |
---|---|---|
OrchestrationEnvironment | orchestrationEnvironment | The orchestration environment. |
JobScheduler(ILogger, IWorkScheduler, IWorkItemStatusService, IJobStatusService, IFlowModelStorageService<WorkItem>)
Initializes a new instance of the JobScheduler class.
Declaration
public JobScheduler(ILogger logger, IWorkScheduler workScheduler, IWorkItemStatusService taskStatusService, IJobStatusService jobStatusService, IFlowModelStorageService<WorkItem> workItemStorageService = null)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | The logger. |
IWorkScheduler | workScheduler | The scheduler. |
IWorkItemStatusService | taskStatusService | The task status service. |
IJobStatusService | jobStatusService | The job status service. |
IFlowModelStorageService<WorkItem> | workItemStorageService | The work item storage service. |
Fields
View SourceBackendIdPropertyName
The property name used to transmit the id of the backend the job executes on.
Declaration
public const string BackendIdPropertyName = null
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceMaxNumberOfConcurrentJobs
Gets or sets the maximum number of concurrent jobs.
Declaration
public int MaxNumberOfConcurrentJobs { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
TaskMonitoringInterval
Gets or sets the task monitoring interval (in seconds).
Declaration
public int TaskMonitoringInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The monitor interval (in seconds). |
UserIdValidator
Gets or sets the
Declaration
public IIdValidator UserIdValidator { get; set; }
Property Value
Type | Description |
---|---|
IIdValidator | The user identifier validator. |
Remarks
By default, the
Methods
View SourceBeginMonitorJobAsync(String)
Begin monitoring the specified Job. Any job and work item event for this job will be pushed through the event handlers on the returned IJobMonitor.
Declaration
public async Task<IJobMonitor> BeginMonitorJobAsync(string jobId)
Parameters
Type | Name | Description |
---|---|---|
System.String | jobId | The job identifier. |
Returns
Type | Description |
---|---|
Task<IJobMonitor> | Asynchronous |
Remarks
The returned task ends when observation has been set up.
CancelJobAsync(String)
Cancels the job.
Declaration
public async Task CancelJobAsync(string jobId)
Parameters
Type | Name | Description |
---|---|---|
System.String | jobId | The job identifier. |
Returns
Type | Description |
---|---|
Task | Cancellation task. |
Remarks
The returned task ends when the job has been cancelled with the backend services.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
EndMonitorJobAsync(String)
End monitoring the specified Job.
Declaration
public async Task EndMonitorJobAsync(string jobId)
Parameters
Type | Name | Description |
---|---|---|
System.String | jobId | The job identifier. |
Returns
Type | Description |
---|---|
Task | Asynchronous |
SubmitJobAsync(Job)
Submits the specified Job and returns a job monitor that allows the client to monitor the status and progress of the job. Any job and work item event for this job will be pushed through the event handlers on the returned IJobMonitor.
Declaration
public async Task<IJobMonitor> SubmitJobAsync(Job job)
Parameters
Type | Name | Description |
---|---|---|
Job | job | The job. |
Returns
Type | Description |
---|---|
Task<IJobMonitor> | A job monitor. |