Show / Hide Table of Contents

    Class BrokerCollection

    Holds a reference to all the registered IBroker implementations and is able to resolve the right instance according to the IEndpoint type.

    Inheritance
    object
    BrokerCollection
    Implements
    IBrokerCollection
    IReadOnlyList<IBroker>
    IReadOnlyCollection<IBroker>
    IEnumerable<IBroker>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Broker
    Assembly: Silverback.Integration.dll
    Syntax
    public class BrokerCollection : IBrokerCollection, IReadOnlyList<IBroker>, IReadOnlyCollection<IBroker>, IEnumerable<IBroker>, IEnumerable

    Constructors

    | Improve this doc View source

    BrokerCollection(IEnumerable<IBroker>)

    Initializes a new instance of the BrokerCollection class.

    Declaration
    public BrokerCollection(IEnumerable<IBroker> brokers)
    Parameters
    Type Name Description
    IEnumerable<IBroker> brokers

    The brokers to be added to the collection.

    Properties

    | Improve this doc View source

    Count

    Gets the number of elements in the collection.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    The number of elements in the collection.

    | Improve this doc View source

    this[int]

    Gets the element at the specified index in the read-only list.

    Declaration
    public IBroker this[int index] { get; }
    Parameters
    Type Name Description
    int index

    The zero-based index of the element to get.

    Property Value
    Type Description
    IBroker

    The element at the specified index in the read-only list.

    Methods

    | Improve this doc View source

    AddConsumer(IConsumerEndpoint)

    Adds an IConsumer that will consume from the specified endpoint as soon as the broker is connected. The received messages will be forwarded to the specified callback delegate.

    Declaration
    public IConsumer AddConsumer(IConsumerEndpoint endpoint)
    Parameters
    Type Name Description
    IConsumerEndpoint endpoint

    The source endpoint.

    Returns
    Type Description
    IConsumer

    The IConsumer for the specified endpoint.

    | Improve this doc View source

    ConnectAsync()

    Connect to all message brokers to start consuming.

    Declaration
    public Task ConnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    DisconnectAsync()

    Disconnect from all message brokers to stop consuming.

    Declaration
    public Task DisconnectAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<IBroker> GetEnumerator()
    Returns
    Type Description
    IEnumerator<IBroker>

    An enumerator that can be used to iterate through the collection.

    | Improve this doc View source

    GetProducer(IProducerEndpoint)

    Returns an IProducer to be used to produce to the specified endpoint.

    Declaration
    public IProducer GetProducer(IProducerEndpoint endpoint)
    Parameters
    Type Name Description
    IProducerEndpoint endpoint

    The target endpoint.

    Returns
    Type Description
    IProducer

    The IProducer for the specified endpoint.

    Implements

    IBrokerCollection
    IReadOnlyList<T>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini