Search Results for

    Show / Hide Table of Contents

    Class EventExtensions

    Inheritance
    System.Object
    EventExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public static class EventExtensions

    Methods

    PublishAsync<TEvent>(TEvent, Mode, CancellationToken)

    publish the event to all subscribers registered to handle this type of event.

    Declaration
    public static Task PublishAsync<TEvent>(this TEvent eventModel, Mode waitMode = Mode.WaitForAll, CancellationToken cancellation = default(CancellationToken))
        where TEvent : IEvent
    Parameters
    Type Name Description
    TEvent eventModel

    the notification event model/dto to publish

    Mode waitMode

    specify whether to wait for none, any or all of the subscribers to complete their work

    System.Threading.CancellationToken cancellation

    an optional cancellation token

    Returns
    Type Description
    System.Threading.Tasks.Task

    a Task that matches the wait mode specified. WaitForNone returns an already completed Task (fire and forget). WaitForAny returns a Task that will complete when any of the subscribers complete their work. WaitForAll return a Task that will complete only when all of the subscribers complete their work.

    Type Parameters
    Name Description
    TEvent

    the type of the event model

    In This Article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX