Search Results for

    Show / Hide Table of Contents

    Class EventReceiver<TEvent>

    the default implementation of an event receiver that can be used to test the execution of and event.

    Inheritance
    object
    EventReceiver<TEvent>
    Implements
    IEventReceiver<TEvent>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.Messaging.Core.dll
    Syntax
    public sealed class EventReceiver<TEvent> : IEventReceiver<TEvent> where TEvent : notnull
    Type Parameters
    Name Description
    TEvent

    the type of the event

    Methods

    WaitForMatchAsync(Func<TEvent, bool>, int, CancellationToken)

    waits until at least one matching event is received not exceeding the timeout period.

    Declaration
    public Task<IEnumerable<TEvent>> WaitForMatchAsync(Func<TEvent, bool> match, int timeoutSeconds = 2, CancellationToken ct = default)
    Parameters
    Type Name Description
    Func<TEvent, bool> match

    a predicate for matching events that should be returned by the method

    int timeoutSeconds

    how long the method will wait until a matching event is received. default value is 2 seconds

    CancellationToken ct

    optional cancellation token

    Returns
    Type Description
    Task<IEnumerable<TEvent>>

    Implements

    IEventReceiver<TEvent>
    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX