Interface IJobStorageRecord
the contract for a job storage record entity
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public interface IJobStorageRecord
Properties
Command
the actual command object that will be embedded in the storage record. if your database/orm (such as ef-core) doesn't support embedding objects, you can take the following steps:
1. add a [NotMapped] attribute to this property.
2. add a new property, either a string or byte[]
3. implement both GetCommand() and SetCommand() methods to serialize/deserialize the command object back and forth and store it in the newly added property.
you may use any serializer you please. recommendation is to use MessagePack.
Declaration
object Command { get; set; }
Property Value
Type | Description |
---|---|
object |
ExecuteAfter
the job will not be executed before this date/time. by default, it will automatically be set to the time of creation allowing jobs to be executed as soon as they're created.
Declaration
DateTime ExecuteAfter { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
ExpireOn
the expiration date/time of job. if the job remains in an incomplete state past this time, the record is considered stale, and will be marked for removal from storage.
Declaration
DateTime ExpireOn { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
IsComplete
indicates whether the job has successfully completed or not.
Declaration
bool IsComplete { get; set; }
Property Value
Type | Description |
---|---|
bool |
QueueID
a unique id for the job queue. each command type has its own queue. this is automatically generated by the library.
Declaration
string QueueID { get; set; }
Property Value
Type | Description |
---|---|
string |
TrackingID
a unique id used to track a particular job for the purpose of progress monitoring and/or termination.
Declaration
Guid TrackingID { get; set; }
Property Value
Type | Description |
---|---|
Guid |
Methods
GetCommand<TCommand>()
implement this function to customize command deserialization.
Declaration
TCommand GetCommand<TCommand>() where TCommand : class, ICommandBase
Returns
Type | Description |
---|---|
TCommand |
Type Parameters
Name | Description |
---|---|
TCommand |
SetCommand<TCommand>(TCommand)
implement this method to customize command serialization.
Declaration
void SetCommand<TCommand>(TCommand command) where TCommand : class, ICommandBase
Parameters
Type | Name | Description |
---|---|---|
TCommand | command |
Type Parameters
Name | Description |
---|---|
TCommand |