Search Results for

    Show / Hide Table of Contents

    Class CommandBus

    • Concrete implementation of ICommandBus.
    • Multiple handlers per command type (fan-out) by design.
    • Thread-safe for Register/Unregister/Dispatch using a lock.
    • Dispatch executes handlers outside the lock using a snapshot.
    Inheritance
    object
    MessageBusBase<ICommand>
    CommandBus
    Implements
    ICommandBus
    Inherited Members
    MessageBusBase<ICommand>.Register<T>(Action<T>)
    MessageBusBase<ICommand>.Unregister<T>(Action<T>)
    MessageBusBase<ICommand>.Dispatch<T>(T)
    MessageBusBase<ICommand>.TryDispatch<T>(T)
    MessageBusBase<ICommand>.IsRegistered<T>()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9
    Assembly: Glitch9.dll
    Syntax
    public class CommandBus : MessageBusBase<ICommand>, ICommandBus

    Constructors

    | Edit this page View Source

    CommandBus(string)

    Declaration
    public CommandBus(string debugName = null)
    Parameters
    Type Name Description
    string debugName

    Methods

    | Edit this page View Source

    Register<T>(ICommandHandler<T>)

    Declaration
    public IDisposable Register<T>(ICommandHandler<T> handler) where T : ICommand
    Parameters
    Type Name Description
    ICommandHandler<T> handler
    Returns
    Type Description
    IDisposable
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    Unregister<T>(ICommandHandler<T>)

    Declaration
    public void Unregister<T>(ICommandHandler<T> handler) where T : ICommand
    Parameters
    Type Name Description
    ICommandHandler<T> handler
    Type Parameters
    Name Description
    T

    Implements

    ICommandBus

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation