I am responding to your request to create a new thread to readdress issues previously.
As far as basic quote retrieval [GetBasicQuote], it seems there is no easy way to synchronously request a quote, i.e., block the procedure until the quote has been retrieved. The object fills quickly, but not immediately. Initially I thought it was too much overhead to wait for an out-of-procedure event to fire in order to collect the quote, but now I'm actually wondering about the soundness of applying an identical methodology to both the RequestSymbol(, "true") and "false" cases.
Here's what I'm saying. When you retrieve a quote with "true", indicating you wish to receive realtime updates for it, events begin to fire and you can process them using event logic to manage a stream of symbol updates. (Like if I were to create some sort of ticker.)
However, let's say I need just one quote, and my application cannot proceed until I have it. In that case, I should issue the same request with "false", catch the event, and then that's that. But that's really no different than issuing the request with "true", and simply releasing the handle when the event I'm looking for is caught. What "false" should do is provide me with an IsQuoteReady function, where I can just wait for the object to be filled and process. It doesn't seem like the ActiveX API provides, at this point, a true "on-demand" functionality for quote retrieval. I can simulate on-demand, but without guessing as to how long it will take, it's very difficult to procedurally retrieve a quote.
Worse yet, assuming I can recognize when the event I've semantically designated as "on-demand" fires, if a user passes an invalid symbol, this event never fires. It doesn't time out or issue data indicating my symbol is invalid, it just sits there forever. So unless I program a timeout -- which is hard to set, because it's not up to me, and given CPU load can cause this object fill to be arbitrarily long -- there's no way to count on a simulated procedural quote retrieval ever finishing.
Certainly there are satisfactory, if not stellar, workarounds, but it seems easy enough to even just fill a quote object directly from a request, with the understanding that it might be a few seconds. But the API is in the position to tell me when it's ready, and it's imperfect for me to guess or busy-wait on it. I don't know if other users have critical blocking points like the one I'm describing, but this issue revolves around the situation when regardless of an event queue, an immediate and highest-priority quote check is required.
As far as basic quote retrieval [GetBasicQuote], it seems there is no easy way to synchronously request a quote, i.e., block the procedure until the quote has been retrieved. The object fills quickly, but not immediately. Initially I thought it was too much overhead to wait for an out-of-procedure event to fire in order to collect the quote, but now I'm actually wondering about the soundness of applying an identical methodology to both the RequestSymbol(, "true") and "false" cases.
Here's what I'm saying. When you retrieve a quote with "true", indicating you wish to receive realtime updates for it, events begin to fire and you can process them using event logic to manage a stream of symbol updates. (Like if I were to create some sort of ticker.)
However, let's say I need just one quote, and my application cannot proceed until I have it. In that case, I should issue the same request with "false", catch the event, and then that's that. But that's really no different than issuing the request with "true", and simply releasing the handle when the event I'm looking for is caught. What "false" should do is provide me with an IsQuoteReady function, where I can just wait for the object to be filled and process. It doesn't seem like the ActiveX API provides, at this point, a true "on-demand" functionality for quote retrieval. I can simulate on-demand, but without guessing as to how long it will take, it's very difficult to procedurally retrieve a quote.
Worse yet, assuming I can recognize when the event I've semantically designated as "on-demand" fires, if a user passes an invalid symbol, this event never fires. It doesn't time out or issue data indicating my symbol is invalid, it just sits there forever. So unless I program a timeout -- which is hard to set, because it's not up to me, and given CPU load can cause this object fill to be arbitrarily long -- there's no way to count on a simulated procedural quote retrieval ever finishing.
Certainly there are satisfactory, if not stellar, workarounds, but it seems easy enough to even just fill a quote object directly from a request, with the understanding that it might be a few seconds. But the API is in the position to tell me when it's ready, and it's imperfect for me to guess or busy-wait on it. I don't know if other users have critical blocking points like the one I'm describing, but this issue revolves around the situation when regardless of an event queue, an immediate and highest-priority quote check is required.
Comment