Asynchronous Exchange Calls and Waiting for Trading Results
Summary
This brief technical post illustrates asynchronous exchange operations for retrieving a ticker, retrieving order-book depth, placing a buy order, and requesting hourly records. Each call returns an object immediately, and the example later invokes a wait method to collect its result. The order wait accepts a timeout; if it expires, the result may be undefined and the same object can be waited on again. The depth request may also return null if retrieval fails.
The author asks whether collecting results through sequential wait calls removes the benefit of concurrency and whether callbacks are available. The document does not include an answer, callback example, benchmark, or discussion of the exchange library’s scheduling details. Its value is therefore limited to the basic asynchronous-call pattern and its possible timeout and failure outcomes; it does not establish how to structure concurrent trading logic or guarantee that calls run in parallel.
Key ideas
- The example launches several exchange operations asynchronously and receives waitable result objects.
- Waiting can use a timeout, and an unfinished request may be waited on again.
- A depth request can fail and return null.
- The post raises, but does not answer, whether sequential waits reduce concurrency or callbacks are available.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.