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
job
objectThe job data
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
queue
stringThe queue name
job
objectThe job data
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
jobType
Typethe job type
Returns
ManageJob(string, Guid, GlowAppScope)
Manage a job
IAppJobService.IAppJobManagment ManageJob(string queue, Guid jobId, GlowAppScope scope = GlowAppScope.Service)
Parameters
queue
stringThe queue name
jobId
GuidThe job to manage
scope
GlowAppScopeThe 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
jobType
TypeThe job type to manage
jobId
GuidThe job to manage
scope
GlowAppScopeThe 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
jobId
GuidThe job to manage
scope
GlowAppScopeThe 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
queue
stringThe queue name
scope
GlowAppScopeThe 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
jobType
TypeThe job type to manage
scope
GlowAppScopeThe 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
scope
GlowAppScopeThe 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
job
objectThe job data
cronExpression
stringthe cron expression.
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
queue
stringThe queue name
job
objectThe job data
cronExpression
stringthe cron expression.
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
job
objectThe job data
runAt
DateTimeOffsetRun job at specified time
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
job
objectThe job data
runAfter
TimeSpanRun job after a specific timespan
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
queue
stringThe queue name
job
objectThe job data
runAt
DateTimeOffsetRun job at specified time
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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
queue
stringThe queue name
job
objectThe job data
runAfter
TimeSpanRun job after a specific timespan
cancellationToken
CancellationTokenCancel job submission
scope
GlowAppScopeThe 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.