Class CommandQueue
Implements a basic command queue. The purpose of the queue is to route commands to subscriber methods; validation of a command itself is the responsibility of its subscriber/handler.
public class CommandQueue : ICommandQueue
- Inheritance
-
CommandQueue
- Implements
- Inherited Members
- Extension Methods
Constructors
CommandQueue(ICommandStore, bool)
Constructs the queue.
public CommandQueue(ICommandStore store, bool saveAll = false)
Parameters
storeICommandStoresaveAllbool
Methods
Bookmark(ICommand, DateTimeOffset)
Bookmarks the command for future reference.
public void Bookmark(ICommand command, DateTimeOffset expired)
Parameters
commandICommandexpiredDateTimeOffset
Cancel(Guid)
Cancels a scheduled command.
public void Cancel(Guid command)
Parameters
commandGuid
Complete(Guid)
Completes a scheduled command.
public void Complete(Guid command)
Parameters
commandGuid
MaskCreditCardInErrorMessage(string)
public string MaskCreditCardInErrorMessage(string errorMessage)
Parameters
errorMessagestring
Returns
MaskSensitiveDataInErrorMessage(string)
public string MaskSensitiveDataInErrorMessage(string error)
Parameters
errorstring
Returns
Override<T>(Action<T>, Guid)
Registers a organization-specific custom handler for the command.
public void Override<T>(Action<T> action, Guid organization) where T : ICommand
Parameters
Type Parameters
T
Ping(Action<int>)
Wakes the command queue to check for pending scheduled commands. Executes all commands for which the timer is now elapsed.
public void Ping(Action<int> scheduledCommandRead)
Parameters
Schedule(ICommand, DateTimeOffset?)
Schedules the command for asynchronous execution.
public void Schedule(ICommand command, DateTimeOffset? at = null)
Parameters
commandICommandatDateTimeOffset?
Send(ICommand)
Executes the command synchronously.
public void Send(ICommand command)
Parameters
commandICommand
Start(Guid)
Forces a scheduled command to start.
public bool Start(Guid command)
Parameters
commandGuid
Returns
Subscribe<T>(Action<T>)
One and only one subscriber can register for each command. If a command is sent then it must have a handler.
public void Subscribe<T>(Action<T> action) where T : ICommand
Parameters
actionAction<T>
Type Parameters
T