The Handler supports throttling, a mechanism to control the number of requests sent to Eurex. The implementation of throttling is based on the Sliding Window algorithm.
The throttling works as follows:
The Sliding Window algorithm is used to keep track of the number of requests sent to Eurex. The algorithm works as follows:
\[ T_w = T_i - (T_c - S_{fr}) \]
Where,Eurex provides information related to the throttling in the following messages:
When the Handler receives any of these messages it updates its internal settings to the new one according to the following fields:
Also, the Handler provides additional option to control the throttling - HandlerSettings::throttleMessageMargin. This can be useful if a user wants to decrease the number of requests allowed by throttling settings set by Eurex.
The Handler provides the following callbacks related to the throttling:
When the Handler receives either Session Logon Response or Throttle Update Notification it calls SessionListener::onThrottleSettingsChanged.
When the Handler detects that the number of requests is higher than allowed by Eurex it calls SessionListener::onThrottleDelayStarted and starts waiting. When waiting is finished, the Handler calls SessionListener::onThrottleDelayFinished and sends a blocked request.