Class JobScheduler
Compute job scheduler
Inheritance
Namespace: DNVGL.One.Compute.Scheduling.Scheduler
Assembly: DNVGL.One.Compute.Scheduling.dll
Syntax
public class JobScheduler : object, IJobScheduler, IDisposable
  Constructors
View SourceJobScheduler(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.  | 
      
JobScheduler(OrchestrationEnvironment)
Initializes a new instance of the JobScheduler class.
Declaration
public JobScheduler(OrchestrationEnvironment orchestrationEnvironment)
  Parameters
| Type | Name | Description | 
|---|---|---|
| OrchestrationEnvironment | orchestrationEnvironment | The orchestration environment.  | 
      
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 IIdValidator used for user id validation. If the UserId of the submitted job does not satisfy the Validate(String) method of the validator, the job will not be submitted.
Declaration
public IIdValidator UserIdValidator { get; set; }
  Property Value
| Type | Description | 
|---|---|
| IIdValidator | The user identifier validator.  | 
      
Remarks
By default, the EmailAddressValidator is used.
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 Task<IJobMonitor> BeginMonitorJobAsync(string jobId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | jobId | The job identifier.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<IJobMonitor> | Asynchronous task  | 
      
Remarks
The returned task ends when observation has been set up.
CancelJobAsync(String)
Cancels the job.
Declaration
public 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 Task EndMonitorJobAsync(string jobId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | jobId | The job identifier.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | Asynchronous task  | 
      
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 Task<IJobMonitor> SubmitJobAsync(Job job)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Job | job | The job.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<IJobMonitor> | Job monitor  |