Show / Hide Table of Contents

Class ThrottleParameters

Helper class for storing parameters required for initializing rate throttler in IAlpacaTradingClient class.

Inheritance
System.Object
ThrottleParameters
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public sealed class ThrottleParameters

Constructors

| Improve this Doc View Source

ThrottleParameters(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 Source

Default

Gets throttle parameters initialized with default values.

Declaration
public static ThrottleParameters Default { get; }
Property Value
Type Description
ThrottleParameters
| Improve this Doc View Source

MaxRetryAttempts

Gets or sets maximum number of retry attempts for a single request.

Declaration
public UInt32 MaxRetryAttempts { get; set; }
Property Value
Type Description
UInt32
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

Timeout

Gets or sets the HTTP request timeout. Default timeout value (100 sec) will be used if this property is equal to null or never set.

Declaration
public TimeSpan? Timeout { get; set; }
Property Value
Type Description
System.Nullable<TimeSpan>

Methods

| Improve this Doc View Source

GetAsyncPolicy()

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>
| Improve this Doc View Source

GetMessageHandler()

Gets the custom message handler that supports reconnection logic configured with the current settings.

Declaration
public HttpMessageHandler GetMessageHandler()
Returns
Type Description
HttpMessageHandler
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX