C# Class DotNetWorkQueue.ASendJobToQueue

Base class for sending jobs to transports
Inheritance: ISendJobToQueue
ファイルを表示 Open project: blehnen/DotNetWorkQueue

Protected Properties

Property Type Description
GetTimeFactory IGetTimeFactory
Queue IProducerMethodQueue

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

SendAsync ( IScheduledJob job, DateTimeOffset scheduledTime, Expression actionToRun ) : Task

Sends the specified action to the specified queue.

SendAsync ( IScheduledJob job, DateTimeOffset scheduledTime, LinqExpressionToRun expressionToRun ) : Task

Sends the specified action to the specified queue.

Protected Methods

Method Description
ASendJobToQueue ( IProducerMethodQueue queue, IGetTimeFactory getTimeFactory ) : System

Initializes a new instance of the ASendJobToQueue class.

DeleteJob ( string name ) : void

Deletes the job based on the job name.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

DoesJobExist ( string name, DateTimeOffset scheduledTime ) : QueueStatuses

Returns the status of the job based on name and scheduled time.

JobAlreadyExistsError ( Exception error ) : bool

Return true if the exception indicates that the job already exists.

Used to determine if we should return specific error messages

SetMetaDataForJob ( string jobName, DateTimeOffset scheduledTime, DateTimeOffset eventTime, string route, IAdditionalMessageData messageData ) : void

Sets the specified meta data on the messageData context

Private Methods

Method Description
ProcessResult ( IScheduledJob job, DateTimeOffset scheduledTime, IQueueOutputMessage result ) : IJobQueueOutputMessage
SendPreChecks ( string jobName, DateTimeOffset scheduledTime ) : IJobQueueOutputMessage

Method Details

ASendJobToQueue() protected method

Initializes a new instance of the ASendJobToQueue class.
protected ASendJobToQueue ( IProducerMethodQueue queue, IGetTimeFactory getTimeFactory ) : System
queue IProducerMethodQueue The queue.
getTimeFactory IGetTimeFactory The get time factory.
return System

DeleteJob() protected abstract method

Deletes the job based on the job name.
protected abstract DeleteJob ( string name ) : void
name string The name.
return void

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

DoesJobExist() protected abstract method

Returns the status of the job based on name and scheduled time.
protected abstract DoesJobExist ( string name, DateTimeOffset scheduledTime ) : QueueStatuses
name string The name.
scheduledTime DateTimeOffset The scheduled time.
return QueueStatuses

JobAlreadyExistsError() protected abstract method

Return true if the exception indicates that the job already exists.
Used to determine if we should return specific error messages
protected abstract JobAlreadyExistsError ( Exception error ) : bool
error System.Exception The error.
return bool

SendAsync() public method

Sends the specified action to the specified queue.
public SendAsync ( IScheduledJob job, DateTimeOffset scheduledTime, Expression actionToRun ) : Task
job IScheduledJob The job.
scheduledTime DateTimeOffset The scheduled time.
actionToRun Expression The action to run.
return Task

SendAsync() public method

Sends the specified action to the specified queue.
public SendAsync ( IScheduledJob job, DateTimeOffset scheduledTime, LinqExpressionToRun expressionToRun ) : Task
job IScheduledJob The job.
scheduledTime DateTimeOffset The scheduled time.
expressionToRun DotNetWorkQueue.Messages.LinqExpressionToRun The expression to run.
return Task

SetMetaDataForJob() protected abstract method

Sets the specified meta data on the messageData context
protected abstract SetMetaDataForJob ( string jobName, DateTimeOffset scheduledTime, DateTimeOffset eventTime, string route, IAdditionalMessageData messageData ) : void
jobName string Name of the job.
scheduledTime DateTimeOffset The scheduled time.
eventTime DateTimeOffset The event time.
route string The route. May be null.
messageData IAdditionalMessageData The message data.
return void

Property Details

GetTimeFactory protected_oe property

Time factory for obtaining current date/time
protected IGetTimeFactory GetTimeFactory
return IGetTimeFactory

Queue protected_oe property

The queue to send jobs to.
protected IProducerMethodQueue Queue
return IProducerMethodQueue