Show / Hide Table of Contents

    Class CommandPublisher

    Publishes the messages implementing ICommand or ICommand<TResult>.

    Inheritance
    object
    CommandPublisher
    Implements
    ICommandPublisher
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Publishing
    Assembly: Silverback.Core.Model.dll
    Syntax
    public class CommandPublisher : ICommandPublisher

    Constructors

    | Improve this doc View source

    CommandPublisher(IPublisher)

    Initializes a new instance of the CommandPublisher class.

    Declaration
    public CommandPublisher(IPublisher publisher)
    Parameters
    Type Name Description
    IPublisher publisher

    The IPublisher to be wrapped.

    Methods

    | Improve this doc View source

    Execute(ICommand)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public void Execute(ICommand commandMessage)
    Parameters
    Type Name Description
    ICommand commandMessage

    The command to be executed.

    | Improve this doc View source

    Execute(ICommand, bool)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public void Execute(ICommand commandMessage, bool throwIfUnhandled)
    Parameters
    Type Name Description
    ICommand commandMessage

    The command to be executed.

    bool throwIfUnhandled

    A boolean value indicating whether an exception must be thrown if no subscriber is handling the message.

    | Improve this doc View source

    ExecuteAsync(ICommand)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public Task ExecuteAsync(ICommand commandMessage)
    Parameters
    Type Name Description
    ICommand commandMessage

    The command to be executed.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    ExecuteAsync(ICommand, bool)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public Task ExecuteAsync(ICommand commandMessage, bool throwIfUnhandled)
    Parameters
    Type Name Description
    ICommand commandMessage

    The command to be executed.

    bool throwIfUnhandled

    A boolean value indicating whether an exception must be thrown if no subscriber is handling the message.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    ExecuteAsync<TResult>(ICommand<TResult>)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public Task<TResult> ExecuteAsync<TResult>(ICommand<TResult> commandMessage)
    Parameters
    Type Name Description
    ICommand<TResult> commandMessage

    The command to be executed.

    Returns
    Type Description
    Task<TResult>

    A Task<TResult> representing the asynchronous operation. The task result contains the command result.

    Type Parameters
    Name Description
    TResult

    The type of the result that is expected to be returned by the subscribers.

    | Improve this doc View source

    ExecuteAsync<TResult>(ICommand<TResult>, bool)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the Task will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public Task<TResult> ExecuteAsync<TResult>(ICommand<TResult> commandMessage, bool throwIfUnhandled)
    Parameters
    Type Name Description
    ICommand<TResult> commandMessage

    The command to be executed.

    bool throwIfUnhandled

    A boolean value indicating whether an exception must be thrown if no subscriber is handling the message.

    Returns
    Type Description
    Task<TResult>

    A Task<TResult> representing the asynchronous operation. The task result contains the command result.

    Type Parameters
    Name Description
    TResult

    The type of the result that is expected to be returned by the subscribers.

    | Improve this doc View source

    Execute<TResult>(ICommand<TResult>)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public TResult Execute<TResult>(ICommand<TResult> commandMessage)
    Parameters
    Type Name Description
    ICommand<TResult> commandMessage

    The command to be executed.

    Returns
    Type Description
    TResult

    The command result.

    Type Parameters
    Name Description
    TResult

    The type of the result that is expected to be returned by the subscribers.

    | Improve this doc View source

    Execute<TResult>(ICommand<TResult>, bool)

    Executes the specified command publishing it to the internal bus. The message will be forwarded to its subscribers and the method will not complete until all subscribers have processed it (unless using Silverback.Integration to produce and consume the message through a message broker).

    Declaration
    public TResult Execute<TResult>(ICommand<TResult> commandMessage, bool throwIfUnhandled)
    Parameters
    Type Name Description
    ICommand<TResult> commandMessage

    The command to be executed.

    bool throwIfUnhandled

    A boolean value indicating whether an exception must be thrown if no subscriber is handling the message.

    Returns
    Type Description
    TResult

    The command result.

    Type Parameters
    Name Description
    TResult

    The type of the result that is expected to be returned by the subscribers.

    Implements

    ICommandPublisher
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini