Show / Hide Table of Contents

    Class AsyncEvent<TArg>

    Represents an event that can be handled asynchronously via a ValueTask.

    Inheritance
    object
    AsyncEvent<TArg>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Silverback
    Assembly: Silverback.Core.dll
    Syntax
    public class AsyncEvent<TArg>
    Type Parameters
    Name Description
    TArg

    The type of the event argument.

    Constructors

    AsyncEvent()

    Represents an event that can be handled asynchronously via a ValueTask.

    Declaration
    public AsyncEvent()

    Methods

    AddHandler(Func<TArg, ValueTask>)

    Adds the specified event handler.

    Declaration
    public void AddHandler(Func<TArg, ValueTask> handler)
    Parameters
    Type Name Description
    Func<TArg, ValueTask> handler

    The event handler.

    InvokeAsync(TArg)

    Invokes all registered event handlers.

    Declaration
    public ValueTask InvokeAsync(TArg arg)
    Parameters
    Type Name Description
    TArg arg

    The event argument.

    Returns
    Type Description
    ValueTask

    A ValueTask representing the asynchronous operation.

    RemoveHandler(Func<TArg, ValueTask>)

    Removes the specified event handler.

    Declaration
    public void RemoveHandler(Func<TArg, ValueTask> handler)
    Parameters
    Type Name Description
    Func<TArg, ValueTask> handler

    The event handler.

    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini