Interface IJobStorageRecord
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 array
3. implement both and 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
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
ExpireOn
the expiration date/time of job. if the job remains in an incomplete state past this time, the record is considered stale.
Declaration
DateTime ExpireOn { get; set; }
Property Value
IsComplete
indicates whether the job has successfully completed or not.
Declaration
bool IsComplete { get; set; }
Property Value
QueueID
a unique id for the job queue. each command type has it's own queue. this is automatically generated by the library.
Declaration
string QueueID { get; set; }
Property Value
Methods
GetCommand<TCommand>()
implement this function to customize command deserialization.
Declaration
TCommand GetCommand<TCommand>() where TCommand : ICommand
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 : ICommand
Parameters
Type |
Name |
Description |
TCommand |
command |
|
Type Parameters
Name |
Description |
TCommand |
|