Interface ISubscriptionHandler
Provides unified type-safe access for subscribing/unsubscribing streaming events.
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public interface ISubscriptionHandler
Methods
| Improve this Doc View SourceSubscribeAsync(IAlpacaDataSubscription)
Subscribes a single subscription object for receiving data from the server.
Declaration
ValueTask SubscribeAsync(IAlpacaDataSubscription subscription)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaDataSubscription | subscription | Subscription target - asset and update type holder. |
Returns
| Type | Description |
|---|---|
| ValueTask |
SubscribeAsync(IAlpacaDataSubscription, CancellationToken)
Subscribes a single subscription object for receiving data from the server.
Declaration
ValueTask SubscribeAsync(IAlpacaDataSubscription subscription, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaDataSubscription | subscription | Subscription target - asset and update type holder. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| ValueTask |
SubscribeAsync(IEnumerable<IAlpacaDataSubscription>)
Subscribes several subscriptions objects for receiving data from the server.
Declaration
ValueTask SubscribeAsync(IEnumerable<IAlpacaDataSubscription> subscriptions)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IAlpacaDataSubscription> | subscriptions | List of subscription targets - assets and update type holders. |
Returns
| Type | Description |
|---|---|
| ValueTask |
SubscribeAsync(IEnumerable<IAlpacaDataSubscription>, CancellationToken)
Subscribes several subscriptions objects for receiving data from the server.
Declaration
ValueTask SubscribeAsync(IEnumerable<IAlpacaDataSubscription> subscriptions, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IAlpacaDataSubscription> | subscriptions | List of subscription targets - assets and update type holders. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| ValueTask |
UnsubscribeAsync(IAlpacaDataSubscription)
Unsubscribes the single subscription object for receiving data from the server.
Declaration
ValueTask UnsubscribeAsync(IAlpacaDataSubscription subscription)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaDataSubscription | subscription | Subscription target - asset and update type holder. |
Returns
| Type | Description |
|---|---|
| ValueTask |
UnsubscribeAsync(IAlpacaDataSubscription, CancellationToken)
Unsubscribes the single subscription object for receiving data from the server.
Declaration
ValueTask UnsubscribeAsync(IAlpacaDataSubscription subscription, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaDataSubscription | subscription | Subscription target - asset and update type holder. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| ValueTask |
UnsubscribeAsync(IEnumerable<IAlpacaDataSubscription>)
Unsubscribes several subscriptions objects for receiving data from the server.
Declaration
ValueTask UnsubscribeAsync(IEnumerable<IAlpacaDataSubscription> subscriptions)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IAlpacaDataSubscription> | subscriptions | List of subscription targets - assets and update type holders. |
Returns
| Type | Description |
|---|---|
| ValueTask |
UnsubscribeAsync(IEnumerable<IAlpacaDataSubscription>, CancellationToken)
Unsubscribes several subscriptions objects for receiving data from the server.
Declaration
ValueTask UnsubscribeAsync(IEnumerable<IAlpacaDataSubscription> subscriptions, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IAlpacaDataSubscription> | subscriptions | List of subscription targets - assets and update type holders. |
| CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| ValueTask |