Class HubStream<T1, TItem>
Defines a hub method with one argument that streams items from the server to the client.
Namespace: Singulink.Net.Http.Api
Assembly: Singulink.Net.Http.Api.dll
Syntax
public sealed class HubStream<T1, TItem>
Type Parameters
| Name | Description |
|---|---|
| T1 | The type of the method argument. |
| 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. |