Search Results for

    Show / Hide Table of Contents

    Class TestSubscriber.ManualProbe<T>

    Implementation of Reactive.Streams.ISubscriber{T} that allows various assertions. All timeouts are dilated automatically, for more details about time dilation refer to Akka.Streams.TestKit.

    Inheritance
    object
    TestSubscriber.ManualProbe<T>
    TestSubscriber.Probe<T>
    Implements
    ISubscriber<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.TestKit
    Assembly: Akka.Streams.TestKit.dll
    Syntax
    public class TestSubscriber.ManualProbe<T> : ISubscriber<T>
    Type Parameters
    Name Description
    T

    Properties

    | Edit this page View Source

    Subscription

    Declaration
    public ISubscription Subscription { get; protected set; }
    Property Value
    Type Description
    ISubscription

    Methods

    | Edit this page View Source

    AsyncBuilder()

    Fluent async DSL. This will return an instance of SubscriberFluentBuilder<T> that will compose and run all of its method call asynchronously. Note that SubscriberFluentBuilder<T> contains two types of methods:

    • Methods that returns SubscriberFluentBuilder<T> are used to chain test methods together using a fluent builder pattern.
    • Methods with names that ends with the postfix "Async" and returns either a Task or a Task<TResult>. These methods invokes the previously chained methods asynchronously one after another before executing its own code.
    Declaration
    public SubscriberFluentBuilder<T> AsyncBuilder()
    Returns
    Type Description
    SubscriberFluentBuilder<T>
    | Edit this page View Source

    ExpectComplete(TimeSpan?, CancellationToken)

    Fluent DSL. Expect completion with a timeout.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectComplete(TimeSpan? timeout, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectComplete(CancellationToken)

    Fluent DSL. Expect completion.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectComplete(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectCompleteAsync(CancellationToken)

    Declaration
    public Task ExpectCompleteAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectError(CancellationToken)

    Expect and return the signalled System.Exception/>.

    Declaration
    public Exception ExpectError(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Exception
    | Edit this page View Source

    ExpectErrorAsync(CancellationToken)

    Expect and return the signalled System.Exception/>.

    Declaration
    public Task<Exception> ExpectErrorAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Exception>
    | Edit this page View Source

    ExpectEvent(ISubscriberEvent, CancellationToken)

    Fluent DSL. Expect and return TestSubscriber.ISubscriberEvent (any of: OnSubscribe(ISubscription), OnNext(T), OnError(Exception) or OnComplete()).

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectEvent(TestSubscriber.ISubscriberEvent e, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TestSubscriber.ISubscriberEvent e
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectEvent(CancellationToken)

    Expect and return TestSubscriber.ISubscriberEvent (any of: OnSubscribe(ISubscription), OnNext(T), OnError(Exception) or OnComplete()).

    Declaration
    public TestSubscriber.ISubscriberEvent ExpectEvent(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ISubscriberEvent
    | Edit this page View Source

    ExpectEvent(TimeSpan, CancellationToken)

    Expect and return TestSubscriber.ISubscriberEvent (any of: OnSubscribe(ISubscription), OnNext(T), OnError(Exception) or OnComplete()).

    Declaration
    public TestSubscriber.ISubscriberEvent ExpectEvent(TimeSpan max, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan max
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ISubscriberEvent
    | Edit this page View Source

    ExpectEventAsync(TimeSpan?, CancellationToken)

    Expect and return TestSubscriber.ISubscriberEvent (any of: OnSubscribe(ISubscription), OnNext(T), OnError(Exception) or OnComplete()).

    Declaration
    public Task<TestSubscriber.ISubscriberEvent> ExpectEventAsync(TimeSpan? max, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? max
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TestSubscriber.ISubscriberEvent>
    | Edit this page View Source

    ExpectEventAsync(CancellationToken)

    Expect and return TestSubscriber.ISubscriberEvent (any of: OnSubscribe(ISubscription), OnNext(T), OnError(Exception) or OnComplete()).

    Declaration
    public Task<TestSubscriber.ISubscriberEvent> ExpectEventAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TestSubscriber.ISubscriberEvent>
    | Edit this page View Source

    ExpectEventAsync<TOther>(Func<ISubscriberEvent, TOther>, CancellationToken)

    Declaration
    public Task<TOther> ExpectEventAsync<TOther>(Func<TestSubscriber.ISubscriberEvent, TOther> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<TestSubscriber.ISubscriberEvent, TOther> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ExpectEvent<TOther>(Func<ISubscriberEvent, TOther>, CancellationToken)

    Declaration
    public TOther ExpectEvent<TOther>(Func<TestSubscriber.ISubscriberEvent, TOther> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<TestSubscriber.ISubscriberEvent, TOther> func
    CancellationToken cancellationToken
    Returns
    Type Description
    TOther
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ExpectNext(TimeSpan?, CancellationToken)

    Expect and return a stream element during specified time or timeout.

    Declaration
    public T ExpectNext(TimeSpan? timeout, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    T
    | Edit this page View Source

    ExpectNext(TimeSpan?, CancellationToken, params T[])

    Fluent DSL. Expect multiple stream elements.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNext(TimeSpan? timeout, CancellationToken cancellationToken, params T[] elems)
    Parameters
    Type Name Description
    TimeSpan? timeout
    CancellationToken cancellationToken
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext(TimeSpan?, T, CancellationToken)

    Fluent DSL. Expect a stream element during specified time or timeout.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNext(TimeSpan? timeout, T element, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? timeout
    T element
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext(TimeSpan?, params T[])

    Fluent DSL. Expect multiple stream elements.

    Declaration
    [Obsolete("Use the method with CancellationToken support instead")]
    public TestSubscriber.ManualProbe<T> ExpectNext(TimeSpan? timeout, params T[] elems)
    Parameters
    Type Name Description
    TimeSpan? timeout
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext(CancellationToken)

    Expect and return a stream element.

    Declaration
    public T ExpectNext(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    T
    | Edit this page View Source

    ExpectNext(CancellationToken, params T[])

    Fluent DSL. Expect multiple stream elements.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNext(CancellationToken cancellationToken, params T[] elems)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext(T, TimeSpan?, CancellationToken)

    Fluent DSL. Expect a stream element.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNext(T element, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    T element
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext(params T[])

    Fluent DSL. Expect multiple stream elements.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNext(params T[] elems)
    Parameters
    Type Name Description
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextAsync(TimeSpan?, CancellationToken)

    Expect and return a stream element during specified time or timeout.

    Declaration
    public Task<T> ExpectNextAsync(TimeSpan? timeout, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    | Edit this page View Source

    ExpectNextAsync(CancellationToken)

    Expect and return a stream element.

    Declaration
    public Task<T> ExpectNextAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    | Edit this page View Source

    ExpectNextAsync(T, CancellationToken)

    Declaration
    public Task ExpectNextAsync(T element, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    T element
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectNextAsync(T, TimeSpan, CancellationToken)

    Expect a stream element.

    Declaration
    public Task ExpectNextAsync(T element, TimeSpan timeout, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    T element
    TimeSpan timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectNextAsync<TOther>(Predicate<TOther>, CancellationToken)

    Expect next element and test it with the predicate

    Declaration
    public Task<TOther> ExpectNextAsync<TOther>(Predicate<TOther> predicate, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Predicate<TOther> predicate

    The System.Predicate{T} that is applied to the message

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TOther>

    The next element

    Type Parameters
    Name Description
    TOther

    The System.Type of the expected message

    | Edit this page View Source

    ExpectNextN(IEnumerable<T>, TimeSpan?, CancellationToken)

    Fluent DSL. Expect the given elements to be signalled in order.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextN(IEnumerable<T> all, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IEnumerable<T> all
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextN(long, TimeSpan?, CancellationToken)

    Expect and return the next n stream elements.

    Declaration
    public IEnumerable<T> ExpectNextN(long n, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    long n
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    IEnumerable<T>
    | Edit this page View Source

    ExpectNextNAsync(IEnumerable<T>, TimeSpan?, CancellationToken)

    Expect the given elements to be signalled in order.

    Declaration
    public Task ExpectNextNAsync(IEnumerable<T> all, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IEnumerable<T> all
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectNextNAsync(long, TimeSpan?, CancellationToken)

    Expect and return the next n stream elements.

    Declaration
    public IAsyncEnumerable<T> ExpectNextNAsync(long n, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    long n
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<T>
    | Edit this page View Source

    ExpectNextOrComplete(CancellationToken)

    Expect given next element or stream completion, returning whichever was signaled.

    Declaration
    public object ExpectNextOrComplete(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    object
    | Edit this page View Source

    ExpectNextOrComplete(T, CancellationToken)

    Fluent DSL. Expect given next element or stream completion.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextOrComplete(T element, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    T element
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextOrCompleteAsync(CancellationToken)

    Expect given next element or stream completion, returning whichever was signaled.

    Declaration
    public Task<object> ExpectNextOrCompleteAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<object>
    | Edit this page View Source

    ExpectNextOrError(CancellationToken)

    Expect given next element or error signal, returning whichever was signaled.

    Declaration
    public object ExpectNextOrError(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    object
    | Edit this page View Source

    ExpectNextOrError(T, Exception, CancellationToken)

    Fluent DSL. Expect given next element or error signal.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextOrError(T element, Exception cause, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    T element
    Exception cause
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextOrErrorAsync(CancellationToken)

    Expect given next element or error signal, returning whichever was signaled.

    Declaration
    public Task<object> ExpectNextOrErrorAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<object>
    | Edit this page View Source

    ExpectNextUnordered(TimeSpan?, CancellationToken, params T[])

    FluentDSL. Expect multiple stream elements in arbitrary order during specified timeout.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextUnordered(TimeSpan? timeout, CancellationToken cancellationToken, params T[] elems)
    Parameters
    Type Name Description
    TimeSpan? timeout
    CancellationToken cancellationToken
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextUnordered(TimeSpan?, params T[])

    FluentDSL. Expect multiple stream elements in arbitrary order during specified timeout.

    Declaration
    [Obsolete("Use the method with CancellationToken support instead")]
    public TestSubscriber.ManualProbe<T> ExpectNextUnordered(TimeSpan? timeout, params T[] elems)
    Parameters
    Type Name Description
    TimeSpan? timeout
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextUnordered(CancellationToken, params T[])

    FluentDSL. Expect multiple stream elements in arbitrary order.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextUnordered(CancellationToken cancellationToken, params T[] elems)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextUnordered(params T[])

    Fluent DSL. Expect multiple stream elements in arbitrary order.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextUnordered(params T[] elems)
    Parameters
    Type Name Description
    T[] elems
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextUnorderedN(IEnumerable<T>, TimeSpan?, CancellationToken)

    Fluent DSL. Expect the given elements to be signalled in any order.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextUnorderedN(IEnumerable<T> all, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IEnumerable<T> all
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNextWithinSet(ICollection<T>, CancellationToken)

    FluentDSL. Expect a single stream element matching one of the element in a list. Found element is removed from the list.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNextWithinSet(ICollection<T> elems, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    ICollection<T> elems
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNext<TOther>(Predicate<TOther>, CancellationToken)

    Expect next element and test it with the predicate

    Declaration
    public TOther ExpectNext<TOther>(Predicate<TOther> predicate, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Predicate<TOther> predicate

    The System.Predicate{T} that is applied to the message

    CancellationToken cancellationToken
    Returns
    Type Description
    TOther

    The next element

    Type Parameters
    Name Description
    TOther

    The System.Type of the expected message

    | Edit this page View Source

    ExpectNoMsg(CancellationToken)

    Fluent DSL. Same as ExpectNoMsg(TimeSpan, CancellationToken), but correctly treating the timeFactor.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNoMsg(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNoMsg(TimeSpan, CancellationToken)

    Fluent DSL. Assert that no message is received for the specified time.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectNoMsg(TimeSpan remaining, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan remaining
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    | Edit this page View Source

    ExpectNoMsgAsync(TimeSpan, CancellationToken)

    Assert that no message is received for the specified time.

    Declaration
    public Task ExpectNoMsgAsync(TimeSpan remaining, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan remaining
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectSubscription(CancellationToken)

    Expects and returns Reactive.Streams.ISubscription/>.

    Declaration
    public ISubscription ExpectSubscription(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    ISubscription
    | Edit this page View Source

    ExpectSubscriptionAndComplete(bool, CancellationToken)

    Fluent DSL. Expect subscription followed by immediate stream completion. Depending on the signalDemand parameter demand may be signaled immediately after obtaining the subscription in order to wake up a possibly lazy upstream. You can disable this by setting the signalDemand parameter to false.

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectSubscriptionAndComplete(bool signalDemand, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    bool signalDemand
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    See Also
    ExpectSubscriptionAndComplete(CancellationToken)
    | Edit this page View Source

    ExpectSubscriptionAndComplete(CancellationToken)

    Fluent DSL. Expect subscription followed by immediate stream completion. By default single demand will be signaled in order to wake up a possibly lazy upstream

    Declaration
    public TestSubscriber.ManualProbe<T> ExpectSubscriptionAndComplete(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>
    See Also
    ExpectSubscriptionAndComplete(bool, CancellationToken)
    | Edit this page View Source

    ExpectSubscriptionAndCompleteAsync(bool, CancellationToken)

    Declaration
    public Task ExpectSubscriptionAndCompleteAsync(bool signalDemand = true, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    bool signalDemand
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectSubscriptionAndError(bool, CancellationToken)

    Expect subscription to be followed immediately by an error signal. Depending on the signalDemand parameter demand may be signaled immediately after obtaining the subscription in order to wake up a possibly lazy upstream.You can disable this by setting the signalDemand parameter to false. ExpectSubscriptionAndError(CancellationToken)

    Declaration
    public Exception ExpectSubscriptionAndError(bool signalDemand, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    bool signalDemand
    CancellationToken cancellationToken
    Returns
    Type Description
    Exception
    | Edit this page View Source

    ExpectSubscriptionAndError(CancellationToken)

    Expect subscription to be followed immediately by an error signal. By default single demand will be signaled in order to wake up a possibly lazy upstream. ExpectSubscriptionAndError(bool, CancellationToken)

    Declaration
    public Exception ExpectSubscriptionAndError(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Exception
    | Edit this page View Source

    ExpectSubscriptionAndErrorAsync(bool, CancellationToken)

    Expect subscription to be followed immediately by an error signal. Depending on the signalDemand parameter demand may be signaled immediately after obtaining the subscription in order to wake up a possibly lazy upstream.You can disable this by setting the signalDemand parameter to false. ExpectSubscriptionAndError(CancellationToken)

    Declaration
    public Task<Exception> ExpectSubscriptionAndErrorAsync(bool signalDemand, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    bool signalDemand
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Exception>
    | Edit this page View Source

    ExpectSubscriptionAndErrorAsync(CancellationToken)

    Expect subscription to be followed immediately by an error signal. By default single demand will be signaled in order to wake up a possibly lazy upstream. ExpectSubscriptionAndError(bool, CancellationToken)

    Declaration
    public Task<Exception> ExpectSubscriptionAndErrorAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Exception>
    | Edit this page View Source

    ExpectSubscriptionAsync(CancellationToken)

    Expects and returns Reactive.Streams.ISubscription/>.

    Declaration
    public Task<ISubscription> ExpectSubscriptionAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<ISubscription>
    | Edit this page View Source

    MatchNext<TOther>(Predicate<TOther>, CancellationToken)

    Expect next element and test it with the predicate

    Declaration
    public TestSubscriber.ManualProbe<T> MatchNext<TOther>(Predicate<TOther> predicate, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Predicate<TOther> predicate

    The System.Predicate{T} that is applied to the message

    CancellationToken cancellationToken
    Returns
    Type Description
    TestSubscriber.ManualProbe<T>

    this

    Type Parameters
    Name Description
    TOther

    The System.Type of the expected message

    | Edit this page View Source

    OnComplete()

    Successful terminal state.

    No further events will be sent even if Request(long) is invoked again.

    Declaration
    public void OnComplete()
    | Edit this page View Source

    OnError(Exception)

    Failed terminal state.

    No further events will be sent even if Request(long) is invoked again.

    Declaration
    public void OnError(Exception cause)
    Parameters
    Type Name Description
    Exception cause

    The exception signaled

    | Edit this page View Source

    OnNext(T)

    Data notification sent by the Reactive.Streams.IPublisher<T> in response to requests to Request(long).

    Declaration
    public void OnNext(T element)
    Parameters
    Type Name Description
    T element

    The element signaled

    | Edit this page View Source

    OnSubscribe(ISubscription)

    Invoked after calling Reactive.Streams.IPublisher<T>.Subscribe(Reactive.Streams.ISubscriber<T>).

    No data will start flowing until Request(long) is invoked.

    It is the responsibility of this Reactive.Streams.ISubscriber<T> instance to call Request(long) whenever more data is wanted.

    The Reactive.Streams.IPublisher<T> will send notifications only in response to Request(long).

    Declaration
    public void OnSubscribe(ISubscription subscription)
    Parameters
    Type Name Description
    ISubscription subscription

    Reactive.Streams.ISubscription that allows requesting data via Request(long)

    | Edit this page View Source

    ReceiveWhileAsync<TOther>(TimeSpan?, TimeSpan?, Func<object, TOther>, int, CancellationToken)

    Receive messages for a given duration or until one does not match a given partial function.

    Declaration
    public IAsyncEnumerable<TOther> ReceiveWhileAsync<TOther>(TimeSpan? max = null, TimeSpan? idle = null, Func<object, TOther> filter = null, int msgs = 2147483647, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? max
    TimeSpan? idle
    Func<object, TOther> filter
    int msgs
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ReceiveWhile<TOther>(TimeSpan?, TimeSpan?, Func<object, TOther>, int, CancellationToken)

    Receive messages for a given duration or until one does not match a given partial function.

    Declaration
    public IEnumerable<TOther> ReceiveWhile<TOther>(TimeSpan? max = null, TimeSpan? idle = null, Func<object, TOther> filter = null, int msgs = 2147483647, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? max
    TimeSpan? idle
    Func<object, TOther> filter
    int msgs
    CancellationToken cancellationToken
    Returns
    Type Description
    IEnumerable<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ReceiveWithinAsync<TOther>(TimeSpan?, int, CancellationToken)

    Drains a given number of messages

    Declaration
    public IAsyncEnumerable<TOther> ReceiveWithinAsync<TOther>(TimeSpan? max, int messages = 2147483647, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? max
    int messages
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ReceiveWithin<TOther>(TimeSpan?, int, CancellationToken)

    Drains a given number of messages

    Declaration
    public IEnumerable<TOther> ReceiveWithin<TOther>(TimeSpan? max, int messages = 2147483647, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan? max
    int messages
    CancellationToken cancellationToken
    Returns
    Type Description
    IEnumerable<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    ToStrict(TimeSpan, CancellationToken)

    Attempt to drain the stream into a strict collection (by requesting long.MaxValue elements).

    Declaration
    public IList<T> ToStrict(TimeSpan atMost, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan atMost
    CancellationToken cancellationToken
    Returns
    Type Description
    IList<T>
    Remarks

    Use with caution: Be warned that this may not be a good idea if the stream is infinite or its elements are very large!

    | Edit this page View Source

    ToStrictAsync(TimeSpan, CancellationToken)

    Attempt to drain the stream into a strict collection (by requesting long.MaxValue elements).

    Declaration
    public IAsyncEnumerable<T> ToStrictAsync(TimeSpan atMost, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan atMost
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<T>
    Remarks

    Use with caution: Be warned that this may not be a good idea if the stream is infinite or its elements are very large!

    | Edit this page View Source

    WithinAsync(TimeSpan, Func<Task>, TimeSpan?, CancellationToken)

    Declaration
    public Task WithinAsync(TimeSpan max, Func<Task> actionAsync, TimeSpan? epsilonValue = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan max
    Func<Task> actionAsync
    TimeSpan? epsilonValue
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    WithinAsync<TOther>(TimeSpan, Func<Task<TOther>>, CancellationToken)

    Sane as calling WithinAsync(TimeSpan.Zero, max, function).

    Declaration
    public Task<TOther> WithinAsync<TOther>(TimeSpan max, Func<Task<TOther>> execute, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan max
    Func<Task<TOther>> execute
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    WithinAsync<TOther>(TimeSpan, TimeSpan, Func<Task<TOther>>, CancellationToken)

    Declaration
    public Task<TOther> WithinAsync<TOther>(TimeSpan min, TimeSpan max, Func<Task<TOther>> execute, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan min
    TimeSpan max
    Func<Task<TOther>> execute
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TOther>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    Within<TOther>(TimeSpan, Func<TOther>, CancellationToken)

    Sane as calling Within(TimeSpan.Zero, max, function).

    Declaration
    public TOther Within<TOther>(TimeSpan max, Func<TOther> execute, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan max
    Func<TOther> execute
    CancellationToken cancellationToken
    Returns
    Type Description
    TOther
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    Within<TOther>(TimeSpan, TimeSpan, Func<TOther>, CancellationToken)

    Execute code block while bounding its execution time between min and max. Within<TOther>(TimeSpan, TimeSpan, Func<TOther>, CancellationToken) blocks may be nested. All methods in this class which take maximum wait times are available in a version which implicitly uses the remaining time governed by the innermost enclosing Within<TOther>(TimeSpan, TimeSpan, Func<TOther>, CancellationToken) block.

    Note that the timeout is scaled using Dilated(TimeSpan), which uses the configuration entry "akka.test.timefactor", while the min Duration is not.

    var ret = probe.Within(Timespan.FromMilliseconds(50), () => { test.Tell("ping"); return ExpectMsg<string>(); });

    Declaration
    public TOther Within<TOther>(TimeSpan min, TimeSpan max, Func<TOther> execute, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan min
    TimeSpan max
    Func<TOther> execute
    CancellationToken cancellationToken
    Returns
    Type Description
    TOther
    Type Parameters
    Name Description
    TOther

    Implements

    Reactive.Streams.ISubscriber<T>

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET