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(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. |
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. |
WithReconnect(IAlpacaNewsStreamingClient)
Wraps instance of IAlpacaNewsStreamingClient into the helper class with automatic reconnection support and provide optional reconnection parameters.
Declaration
public static IAlpacaNewsStreamingClient WithReconnect(this IAlpacaNewsStreamingClient client)
Parameters
Type | Name | Description |
---|---|---|
IAlpacaNewsStreamingClient | client | Original streaming client for wrapping. |
Returns
Type | Description |
---|---|
IAlpacaNewsStreamingClient | Wrapped version of the |
WithReconnect(IAlpacaNewsStreamingClient, ReconnectionParameters)
Wraps instance of IAlpacaDataStreamingClient into the helper class with automatic reconnection support with the default reconnection parameters.
Declaration
public static IAlpacaNewsStreamingClient WithReconnect(this IAlpacaNewsStreamingClient client, ReconnectionParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
IAlpacaNewsStreamingClient | client | Original streaming client for wrapping. |
ReconnectionParameters | parameters | Reconnection parameters. |
Returns
Type | Description |
---|---|
IAlpacaNewsStreamingClient | Wrapped version of the |