Table of Contents

Interface ICommandQueue

Namespace
Shift.Common.Timeline.Commands
Assembly
Shift.Common.dll

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

command ICommand
expired DateTimeOffset

Cancel(Guid)

Cancels a scheduled command.

void Cancel(Guid command)

Parameters

command Guid

Complete(Guid)

Completes a scheduled command.

void Complete(Guid command)

Parameters

command Guid

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

action Action<T>
organization Guid

Type Parameters

T

Ping(Action<int>)

Wakes the queue to check for pending scheduled commands.

void Ping(Action<int> scheduledCommandRead)

Parameters

scheduledCommandRead Action<int>

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

command ICommand
at DateTimeOffset?

Send(ICommand)

Sends the command as a synchronous operation.

void Send(ICommand command)

Parameters

command ICommand

Start(Guid)

Starts a scheduled command.

bool Start(Guid command)

Parameters

command Guid

Returns

bool

Subscribe<T>(Action<T>)

Registers a handler for a specific command.

void Subscribe<T>(Action<T> action) where T : ICommand

Parameters

action Action<T>

Type Parameters

T