HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Class HubStream<TItem>

    Defines a hub method with no arguments that streams items from the server to the client. Handled on the server by a hub method with the same name that returns IAsyncEnumerable<T> (or a channel reader) of the item type.

    Inheritance
    object
    HubStream<TItem>
    Namespace: Singulink.Net.Http.Api
    Assembly: Singulink.Net.Http.Api.dll
    Syntax
    public sealed class HubStream<TItem>
    Type Parameters
    Name Description
    TItem

    The type of the streamed items.

    Remarks

    The stream name defaults to the name of the member that the definition is assigned to (via CallerMemberNameAttribute), so definitions are typically declared as static properties in a shared contract class, e.g. public static HubStream<int, Update> Updates { get; } = new();.

    Streaming from a client to the server does not require a separate definition: an IAsyncEnumerable<T> (or channel reader) argument of a HubMessage<T1> or HubMethod<T1, TResult> is streamed to the server automatically.

    Constructors

    Name Description
    HubStream(string)

    Initializes a new instance of the HubStream<TItem> class.

    Properties

    Name Description
    Name

    Gets the stream name.

    Methods

    Name Description
    ToString()

    Returns a string that represents the current object.

    © Singulink. All rights reserved.