Search Results for

    Show / Hide Table of Contents

    Class DefaultMessageConsumer

    Inheritance
    object
    DefaultMessageConsumer
    Implements
    IMessageConsumer
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Messaging.Core.Consumers
    Assembly: LemonEdge.Messaging.Core.dll
    Syntax
    public class DefaultMessageConsumer : IMessageConsumer

    Constructors

    DefaultMessageConsumer()

    Declaration
    public DefaultMessageConsumer()

    Methods

    InitializeAsync(CancellationToken)

    Performs all tasks required to initialize this message consumer

    Declaration
    public Task InitializeAsync(CancellationToken token = default)
    Parameters
    Type Name Description
    CancellationToken token
    Returns
    Type Description
    Task

    RegisterErrorHandler(Func<Exception, CancellationToken, Task>)

    Registers an error handler for all message processing

    Declaration
    public Task RegisterErrorHandler(Func<Exception, CancellationToken, Task> callback)
    Parameters
    Type Name Description
    Func<Exception, CancellationToken, Task> callback

    A delegate that will be executed when an exception occurs

    Returns
    Type Description
    Task

    SubscribeAsync<T>(string, Func<T, CancellationToken, Task>, CancellationToken)

    Creates a subscription to messages of type {T} for a specified topic

    Declaration
    public Task<Guid> SubscribeAsync<T>(string topicName, Func<T, CancellationToken, Task> callback, CancellationToken token = default)
    Parameters
    Type Name Description
    string topicName

    The topic to which will be subscribed

    Func<T, CancellationToken, Task> callback

    A delegate that will be executed when a message of type {T} is received

    CancellationToken token
    Returns
    Type Description
    Task<Guid>

    A subscription token that may be used to unsubscribe

    Type Parameters
    Name Description
    T

    Unsubscribe(Guid)

    Unsubscribes the subscription indicated by the subscription token

    Declaration
    public void Unsubscribe(Guid subscriptionToken)
    Parameters
    Type Name Description
    Guid subscriptionToken

    The token returned from the initial call to Subscribe<T>

    Implements

    IMessageConsumer

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.