Show / Hide Table of Contents

    Class EventListener<TContract>

    Represents a communication listener for receiving events.

    Inheritance
    System.Object
    EventListener<TContract>
    Namespace: Copper.Eventing.Service
    Assembly: Copper.Eventing.Service.dll
    Syntax
    public class EventListener<TContract> : ICommunicationListener where TContract : class
    Type Parameters
    Name Description
    TContract

    Constructors

    View Source

    EventListener(IEventReceiver, TContract)

    Initializes a new instance of the EventListener<TContract> class.

    Declaration
    public EventListener(IEventReceiver eventReceiver, TContract serviceImplementation)
    Parameters
    Type Name Description
    IEventReceiver eventReceiver

    The event receiver.

    TContract serviceImplementation

    The service implementation.

    Methods

    View Source

    Abort()

    This method causes the communication listener to close. Close is a terminal state and this method causes the transition to close ungracefully. Any outstanding operations (including close) should be canceled when this method is called.

    Declaration
    public void Abort()
    View Source

    CloseAsync(CancellationToken)

    This method causes the communication listener to close. Close is a terminal state and this method allows the communication listener to transition to this state in a graceful manner.

    Declaration
    public Task CloseAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task that represents outstanding operation.

    View Source

    OpenAsync(CancellationToken)

    This method causes the communication listener to be opened. Once the Open completes, the communication listener becomes usable - accepts and sends messages.

    Declaration
    public Task<string> OpenAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    A System.Threading.Tasks.Task that represents outstanding operation. The result of the Task is the endpoint string.

    • View Source
    In This Article
    • Constructors
      • EventListener(IEventReceiver, TContract)
    • Methods
      • Abort()
      • CloseAsync(CancellationToken)
      • OpenAsync(CancellationToken)
    Back to top Generated by DocFX