Table of Contents

Class CommandQueue

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

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

store ICommandStore
saveAll bool

Methods

Bookmark(ICommand, DateTimeOffset)

Bookmarks the command for future reference.

public void Bookmark(ICommand command, DateTimeOffset expired)

Parameters

command ICommand
expired DateTimeOffset

Cancel(Guid)

Cancels a scheduled command.

public void Cancel(Guid command)

Parameters

command Guid

Complete(Guid)

Completes a scheduled command.

public void Complete(Guid command)

Parameters

command Guid

MaskCreditCardInErrorMessage(string)

public string MaskCreditCardInErrorMessage(string errorMessage)

Parameters

errorMessage string

Returns

string

MaskSensitiveDataInErrorMessage(string)

public string MaskSensitiveDataInErrorMessage(string error)

Parameters

error string

Returns

string

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

action Action<T>
organization Guid

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

scheduledCommandRead Action<int>

Schedule(ICommand, DateTimeOffset?)

Schedules the command for asynchronous execution.

public void Schedule(ICommand command, DateTimeOffset? at = null)

Parameters

command ICommand
at DateTimeOffset?

Send(ICommand)

Executes the command synchronously.

public void Send(ICommand command)

Parameters

command ICommand

Start(Guid)

Forces a scheduled command to start.

public bool Start(Guid command)

Parameters

command Guid

Returns

bool

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

action Action<T>

Type Parameters

T