Package info.bitrich.xchangestream.util
Class Events
java.lang.Object
info.bitrich.xchangestream.util.Events
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Runnable
onApiCall
(ExchangeSpecification exchangeSpecification) Returns the registered handler for theBEFORE_API_CALL_HANDLER
event.
-
Field Details
-
BEFORE_API_CALL_HANDLER
Exchange-specific parameter used for providing aRunnable
action to be run prior to any API calls initiated during the course of maintaining a streamed connection.While some exchanges allow bidirectional streamed communication, such that a socket can be opened and then authenticated, others perform authentication by means of a separate API call which can count towards API rate limits. In addition, many exchanges require API calls to obtain initial snapshots for streamed data such as order books or account updates. XChange requires that the developer manage rate limits themselves, but this is not possible when xchange-stream has to initiate these API calls automatically. This parameter provides a means for the developer to get a callback prior to these API calls, principally to apply such rate limiting globally. However, in principle there are wider potential uses.
-
-
Constructor Details
-
Events
public Events()
-
-
Method Details
-
onApiCall
Returns the registered handler for theBEFORE_API_CALL_HANDLER
event.- Parameters:
exchangeSpecification
- The exchange specification.- Returns:
- The handler.
-