Interface IAppJobService
Build-in distributed job scheduling service.
public interface IAppJobService
Methods
EnqueueAsync(object, CancellationToken, GlowAppScope)
Enqueue a job for execution
IAppJobService.IAppJobEnqueueHandler EnqueueAsync(object job, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobobjectThe job data
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
EnqueueAsync(string, object, CancellationToken, GlowAppScope)
Enqueue a job for execution
IAppJobService.IAppJobEnqueueHandler EnqueueAsync(string queue, object job, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
jobobjectThe job data
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
GetQueueNameFromType(Type)
Get a queue name from job type.
string GetQueueNameFromType(Type jobType)
Parameters
jobTypeTypethe job type
Returns
ManageJob(string, Guid, GlowAppScope)
Manage a job
IAppJobService.IAppJobManagment ManageJob(string queue, Guid jobId, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
jobIdGuidThe job to manage
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ManageJob(Type, Guid, GlowAppScope)
Manage a job
IAppJobService.IAppJobManagment ManageJob(Type jobType, Guid jobId, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobTypeTypeThe job type to manage
jobIdGuidThe job to manage
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ManageJob<TJobType>(Guid, GlowAppScope)
Manage a job
IAppJobService.IAppJobManagment ManageJob<TJobType>(Guid jobId, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobIdGuidThe job to manage
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
Type Parameters
TJobType
ManageQueue(string, GlowAppScope)
Manage queue
IAppJobService.IAppJobQueueManagment ManageQueue(string queue, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ManageQueue(Type, GlowAppScope)
Manage queue
IAppJobService.IAppJobQueueManagment ManageQueue(Type jobType, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobTypeTypeThe job type to manage
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ManageQueue<TJobType>(GlowAppScope)
Manage queue
IAppJobService.IAppJobQueueManagment ManageQueue<TJobType>(GlowAppScope scope = GlowAppScope.Service)
Parameters
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
Type Parameters
TJobType
RecurringAsync(object, string, CancellationToken, GlowAppScope)
Add a recurring job to run at a specific intervals
IAppJobService.IAppRecurringJobHandler RecurringAsync(object job, string cronExpression, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobobjectThe job data
cronExpressionstringthe cron expression.
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
RecurringAsync(string, object, string, CancellationToken, GlowAppScope)
Add a recurring job to run at a specific intervals
IAppJobService.IAppRecurringJobHandler RecurringAsync(string queue, object job, string cronExpression, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
jobobjectThe job data
cronExpressionstringthe cron expression.
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ScheduleAsync(object, DateTimeOffset, CancellationToken, GlowAppScope)
Schedule a job to run at a specific DateTime
IAppJobService.IAppJobScheduleHandler ScheduleAsync(object job, DateTimeOffset runAt, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobobjectThe job data
runAtDateTimeOffsetRun job at specified time
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ScheduleAsync(object, TimeSpan, CancellationToken, GlowAppScope)
Schedule a job to run after a specific timespan
IAppJobService.IAppJobScheduleHandler ScheduleAsync(object job, TimeSpan runAfter, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
jobobjectThe job data
runAfterTimeSpanRun job after a specific timespan
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ScheduleAsync(string, object, DateTimeOffset, CancellationToken, GlowAppScope)
Schedule a job to run at a specific DateTime
IAppJobService.IAppJobScheduleHandler ScheduleAsync(string queue, object job, DateTimeOffset runAt, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
jobobjectThe job data
runAtDateTimeOffsetRun job at specified time
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.
Returns
ScheduleAsync(string, object, TimeSpan, CancellationToken, GlowAppScope)
Schedule a job to run after a specific timespan
IAppJobService.IAppJobScheduleHandler ScheduleAsync(string queue, object job, TimeSpan runAfter, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)
Parameters
queuestringThe queue name
jobobjectThe job data
runAfterTimeSpanRun job after a specific timespan
cancellationTokenCancellationTokenCancel job submission
scopeGlowAppScopeThe scope of the queue.
- QuantumSpace scope means the queue is shared with other services in the same QuantumSpace.
- Service scope means this queue is only visible to other instances of the same service.