Class ThrottleParameters
Helper class for storing parameters required for initializing rate throttler in IAlpacaTradingClient class.
Inheritance
Inherited Members
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public sealed class ThrottleParameters
Constructors
| Improve this Doc View SourceThrottleParameters(UInt32, IEnumerable<SocketError>, IEnumerable<HttpStatusCode>)
Creates new instance of ThrottleParameters object.
Declaration
public ThrottleParameters(UInt32 maxRetryAttempts, IEnumerable<SocketError> retrySocketErrorCodes, IEnumerable<HttpStatusCode> retryHttpStatuses)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | maxRetryAttempts | |
IEnumerable<SocketError> | retrySocketErrorCodes | |
IEnumerable<System.Net.HttpStatusCode> | retryHttpStatuses |
Properties
| Improve this Doc View SourceDefault
Gets throttle parameters initialized with default values.
Declaration
public static ThrottleParameters Default { get; }
Property Value
Type | Description |
---|---|
ThrottleParameters |
MaxRetryAttempts
Gets or sets maximum number of retry attempts for a single request.
Declaration
public UInt32 MaxRetryAttempts { get; set; }
Property Value
Type | Description |
---|---|
UInt32 |
RetryHttpStatuses
Gets set of HTTP status codes which when received should initiate a retry of the affected request.
Declaration
public ISet<HttpStatusCode> RetryHttpStatuses { get; }
Property Value
Type | Description |
---|---|
ISet<System.Net.HttpStatusCode> |
RetrySocketErrorCodes
Gets set of socket error codes which when received should initiate a retry of the affected request.
Declaration
public ISet<SocketError> RetrySocketErrorCodes { get; }
Property Value
Type | Description |
---|---|
ISet<SocketError> |
Timeout
Gets or sets the HTTP request timeout. Default null
or never set.
Declaration
public TimeSpan? Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<TimeSpan> |
Methods
| Improve this Doc View SourceGetAsyncPolicy()
Gets the custom Polly asynchronous execution policy (can be used by unit tests and DI containers).
Declaration
public IAsyncPolicy<HttpResponseMessage> GetAsyncPolicy()
Returns
Type | Description |
---|---|
Polly.IAsyncPolicy<HttpResponseMessage> |
GetMessageHandler()
Gets the custom message handler that supports reconnection logic configured with the current settings.
Declaration
public HttpMessageHandler GetMessageHandler()
Returns
Type | Description |
---|---|
HttpMessageHandler |