Search Results for

    Show / Hide Table of Contents

    Class PublisherFluentBuilder<T>

    Inheritance
    object
    PublisherFluentBuilder<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 PublisherFluentBuilder<T>
    Type Parameters
    Name Description
    T

    Properties

    | Edit this page View Source

    Probe

    Declaration
    public TestPublisher.ManualProbe<T> Probe { get; }
    Property Value
    Type Description
    TestPublisher.ManualProbe<T>

    Methods

    | Edit this page View Source

    EnsureSubscription()

    Asserts that a subscription has been received or will be received

    Declaration
    public PublisherFluentBuilder<T> EnsureSubscription()
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    ExecuteAsync(Func<Task>?, CancellationToken)

    Execute the async chain.

    Declaration
    public Task ExecuteAsync(Func<Task>? asyncAction = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task> asyncAction
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    InvalidOperationException
    | Edit this page View Source

    ExpectCancellation()

    Declaration
    public PublisherFluentBuilder<T> ExpectCancellation()
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    ExpectEventAsync(CancellationToken)

    Execute the async chain and then expect a publisher event from the stream. NOTE: This method will execute the async chain

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

    ExpectNoMsg()

    Fluent async DSL Expect no messages.

    Declaration
    public PublisherFluentBuilder<T> ExpectNoMsg()
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    ExpectNoMsg(TimeSpan, CancellationToken)

    Fluent async DSL Expect no messages for given duration.

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

    ExpectRequest(ISubscription, int)

    Fluent async DSL Expect demand from the given subscription.

    Declaration
    public PublisherFluentBuilder<T> ExpectRequest(ISubscription subscription, int nrOfElements)
    Parameters
    Type Name Description
    ISubscription subscription
    int nrOfElements
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    ExpectRequestAsync(CancellationToken)

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

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

    Execute the async chain and then receive messages for a given duration or until one does not match a given partial function. NOTE: This method will execute the async chain

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

    SendComplete()

    Declaration
    public PublisherFluentBuilder<T> SendComplete()
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    SendError(Exception)

    Declaration
    public PublisherFluentBuilder<T> SendError(Exception e)
    Parameters
    Type Name Description
    Exception e
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    SendNext(IEnumerable<T>)

    Declaration
    public PublisherFluentBuilder<T> SendNext(IEnumerable<T> elements)
    Parameters
    Type Name Description
    IEnumerable<T> elements
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    SendNext(T)

    Declaration
    public PublisherFluentBuilder<T> SendNext(T element)
    Parameters
    Type Name Description
    T element
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

    UnsafeSendNext(T)

    Declaration
    public PublisherFluentBuilder<T> UnsafeSendNext(T element)
    Parameters
    Type Name Description
    T element
    Returns
    Type Description
    PublisherFluentBuilder<T>
    | Edit this page View Source

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

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

    NOTE: This method will execute the async chain

    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)

    Execute the async chain and then execute the code block while bounding its execution time between min and max. WithinAsync<TOther>(TimeSpan, TimeSpan, Func<Task<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 WithinAsync<TOther>(TimeSpan, TimeSpan, Func<Task<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 = await probe.AsyncBuilder().Within(Timespan.FromMilliseconds(50), Timespan.FromSeconds(3), async () => { test.Tell("ping"); return await ExpectMsgAsync<string>(); });

    NOTE: This method will execute the async chain

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

    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