Class AlpacaNewsStreamingClientExtensions
Helper extension method for creating special version of the IAlpacaNewsStreamingClient implementation with automatic reconnection (with configurable delay and number of attempts) support.
Inheritance
Inherited Members
Namespace: Alpaca.Markets.Extensions
Assembly: Alpaca.Markets.Extensions.dll
Syntax
public static class AlpacaNewsStreamingClientExtensions
Methods
| Improve this Doc View SourceGetNewsSubscription()
Declaration
public IAlpacaDataSubscription<INewsArticle> GetNewsSubscription()
Returns
| Type | Description |
|---|---|
| IAlpacaDataSubscription<INewsArticle> |
GetNewsSubscription(IAlpacaNewsStreamingClient, IEnumerable<String>)
Gets the news articles updates subscription for the all assets from the symbols list.
Declaration
public static IAlpacaDataSubscription<INewsArticle> GetNewsSubscription(this IAlpacaNewsStreamingClient client, IEnumerable<String> symbols)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaNewsStreamingClient | client | Target instance of the IAlpacaNewsStreamingClient interface. |
| IEnumerable<String> | symbols | Alpaca asset names list (non-empty) for news articles updates subscribing. |
Returns
| Type | Description |
|---|---|
| IAlpacaDataSubscription<INewsArticle> | Subscription object for tracking updates via the Received event. |
GetNewsSubscription(IAlpacaNewsStreamingClient, String[])
Gets the news articles updates subscription for the all assets from the symbols list.
Declaration
public static IAlpacaDataSubscription<INewsArticle> GetNewsSubscription(this IAlpacaNewsStreamingClient client, params String[] symbols)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaNewsStreamingClient | client | Target instance of the IAlpacaNewsStreamingClient interface. |
| String[] | symbols | Alpaca asset names list (non-empty) for news articles updates subscribing. |
Returns
| Type | Description |
|---|---|
| IAlpacaDataSubscription<INewsArticle> | Subscription object for tracking updates via the Received event. |
GetNewsSubscription(String)
Declaration
public IAlpacaDataSubscription<INewsArticle> GetNewsSubscription(String symbol)
Parameters
| Type | Name | Description |
|---|---|---|
| String | symbol |
Returns
| Type | Description |
|---|---|
| IAlpacaDataSubscription<INewsArticle> |
SubscribeNewsAsync(IAlpacaNewsStreamingClient, IEnumerable<String>)
Gets the news articles updates subscription for all assets from the symbols list.
This subscription is returned with pending subscription state and will be unsubscribed on disposing
so you can use it inside the using or await using statements for more clear resource management.
Declaration
public static ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> SubscribeNewsAsync(this IAlpacaNewsStreamingClient client, IEnumerable<String> symbols)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaNewsStreamingClient | client | Target instance of the IAlpacaNewsStreamingClient interface. |
| IEnumerable<String> | symbols | Alpaca asset names list (non-empty) for news articles updates subscribing. |
Returns
| Type | Description |
|---|---|
| ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> | Subscription object for tracking updates via the Received event. |
SubscribeNewsAsync(IAlpacaNewsStreamingClient, String)
Gets the news articles updates subscription for the symbol asset. This subscription is
returned with pending subscription state and will be unsubscribed on disposing so you can use it
inside the using or await using statements for more clear resource management.
Declaration
public static ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> SubscribeNewsAsync(this IAlpacaNewsStreamingClient client, String symbol)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaNewsStreamingClient | client | Target instance of the IAlpacaNewsStreamingClient interface. |
| String | symbol | Alpaca asset name for news articles updates subscribing. |
Returns
| Type | Description |
|---|---|
| ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> | Subscription object for tracking updates via the Received event. |
SubscribeNewsAsync(IAlpacaNewsStreamingClient, String[])
Gets the news articles updates subscription for all assets from the symbols list.
This subscription is returned with pending subscription state and will be unsubscribed on disposing
so you can use it inside the using or await using statements for more clear resource management.
Declaration
public static ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> SubscribeNewsAsync(this IAlpacaNewsStreamingClient client, params String[] symbols)
Parameters
| Type | Name | Description |
|---|---|---|
| IAlpacaNewsStreamingClient | client | Target instance of the IAlpacaNewsStreamingClient interface. |
| String[] | symbols | Alpaca asset names list (non-empty) for news articles updates subscribing. |
Returns
| Type | Description |
|---|---|
| ValueTask<IDisposableAlpacaDataSubscription<INewsArticle>> | Subscription object for tracking updates via the Received event. |