Table of Contents

Interface IAppJobService

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll

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 object

The job data

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobEnqueueHandler

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 string

The queue name

job object

The job data

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobEnqueueHandler

GetQueueNameFromType(Type)

Get a queue name from job type.

string GetQueueNameFromType(Type jobType)

Parameters

jobType Type

the job type

Returns

string

ManageJob(string, Guid, GlowAppScope)

Manage a job

IAppJobService.IAppJobManagment ManageJob(string queue, Guid jobId, GlowAppScope scope = GlowAppScope.Service)

Parameters

queue string

The queue name

jobId Guid

The job to manage

scope GlowAppScope

The 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

IAppJobService.IAppJobManagment

ManageJob(Type, Guid, GlowAppScope)

Manage a job

IAppJobService.IAppJobManagment ManageJob(Type jobType, Guid jobId, GlowAppScope scope = GlowAppScope.Service)

Parameters

jobType Type

The job type to manage

jobId Guid

The job to manage

scope GlowAppScope

The 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

IAppJobService.IAppJobManagment

ManageJob<TJobType>(Guid, GlowAppScope)

Manage a job

IAppJobService.IAppJobManagment ManageJob<TJobType>(Guid jobId, GlowAppScope scope = GlowAppScope.Service)

Parameters

jobId Guid

The job to manage

scope GlowAppScope

The 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

IAppJobService.IAppJobManagment

Type Parameters

TJobType

ManageQueue(string, GlowAppScope)

Manage queue

IAppJobService.IAppJobQueueManagment ManageQueue(string queue, GlowAppScope scope = GlowAppScope.Service)

Parameters

queue string

The queue name

scope GlowAppScope

The 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

IAppJobService.IAppJobQueueManagment

ManageQueue(Type, GlowAppScope)

Manage queue

IAppJobService.IAppJobQueueManagment ManageQueue(Type jobType, GlowAppScope scope = GlowAppScope.Service)

Parameters

jobType Type

The job type to manage

scope GlowAppScope

The 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

IAppJobService.IAppJobQueueManagment

ManageQueue<TJobType>(GlowAppScope)

Manage queue

IAppJobService.IAppJobQueueManagment ManageQueue<TJobType>(GlowAppScope scope = GlowAppScope.Service)

Parameters

scope GlowAppScope

The 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

IAppJobService.IAppJobQueueManagment

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 object

The job data

cronExpression string

the cron expression.

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppRecurringJobHandler

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 string

The queue name

job object

The job data

cronExpression string

the cron expression.

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppRecurringJobHandler

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 object

The job data

runAt DateTimeOffset

Run job at specified time

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobScheduleHandler

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 object

The job data

runAfter TimeSpan

Run job after a specific timespan

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobScheduleHandler

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 string

The queue name

job object

The job data

runAt DateTimeOffset

Run job at specified time

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobScheduleHandler

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 string

The queue name

job object

The job data

runAfter TimeSpan

Run job after a specific timespan

cancellationToken CancellationToken

Cancel job submission

scope GlowAppScope

The 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

IAppJobService.IAppJobScheduleHandler