Skip to content

calling d[:history] in a for loop #40

Answered by lbilli
EthanRLeonard asked this question in Q&A
Discussion options

You must be logged in to vote

The main issue is that IB API is designed around an asynchronous communication model: i.e. conceptually, sending and receiving data are handled by separate processes which are not in sync.

In particular, functions that send requests return immediately, without waiting for responses to arrive.
Responses, if any, arrive at unpredictable times and are handled in a separate line of execution ("reader process").

Some general references on the topic from Julia docs and the IB API docs.

In your example, the attempt to access d[history] happens right after sending the request, when the requested data has not arrived yet (in fact the request itself may not even have left your computer!).

A quick a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EthanRLeonard
Comment options

Answer selected by EthanRLeonard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants