Interface ICommandQueue
Provides the features for a basic service bus that supports sending and scheduling commands.
public interface ICommandQueue
- Extension Methods
Methods
Bookmark(ICommand, DateTimeOffset)
Inserts a command for future reference. It is not sent or scheduled.
void Bookmark(ICommand command, DateTimeOffset expired)
Parameters
commandICommandexpiredDateTimeOffset
Cancel(Guid)
Cancels a scheduled command.
void Cancel(Guid command)
Parameters
commandGuid
Complete(Guid)
Completes a scheduled command.
void Complete(Guid command)
Parameters
commandGuid
Override<T>(Action<T>, Guid)
Register a custom organization-specific handler for the command.
void Override<T>(Action<T> action, Guid organization) where T : ICommand
Parameters
Type Parameters
T
Ping(Action<int>)
Wakes the queue to check for pending scheduled commands.
void Ping(Action<int> scheduledCommandRead)
Parameters
Schedule(ICommand, DateTimeOffset?)
Sends the command as an asynchronous operation, scheduled for sending at some specific date and time.
void Schedule(ICommand command, DateTimeOffset? at = null)
Parameters
commandICommandatDateTimeOffset?
Send(ICommand)
Sends the command as a synchronous operation.
void Send(ICommand command)
Parameters
commandICommand
Start(Guid)
Starts a scheduled command.
bool Start(Guid command)
Parameters
commandGuid
Returns
Subscribe<T>(Action<T>)
Registers a handler for a specific command.
void Subscribe<T>(Action<T> action) where T : ICommand
Parameters
actionAction<T>
Type Parameters
T