-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling pre-flight requests directly #59
Comments
We could, yeah. I can implement it, it shouldn't be too much work. Do you think you could help out prepping a list of endpoints that need pre-flight requests? As for what's recommended - I suggest you ask IBKR support about this, I don't know how their server side is implemented. |
Ok. After looking the code, The pre-flight checks for the /iserver/marketdata/snapshot endpoint are present in the higher-level live_marketdata_snapshot_by_symbol method, which takes a symbol as input. However, these checks are absent in the lower-level live_marketdata_snapshot method, which directly calls the endpoint. For improved consistency and to ensure the pre-flight logic is always executed, it's better to move it to live_marketdata_snapshot. As for listing endpoint, I see three endpoints with pre-flight logic :
|
Thanks for these observations. Right, I'm trying to think how to implement this correctly. I remember that I've considered doing the pre-flights in library before, but decided not to because of the following limitations. We could:
Here lies the issue: If we communicate to the user that we take care of pre-flights, they may not be inclined to continue calling the endpoint in order to collect more data, which may be advisable in some cases. I've seen similar issue with live orders pre-flights. I'm on the fence, since I do think it would be a good idea to automate things if possible. Not doing it however, would cause each user to read about the pre-flights individually, and through hands-on trial and error discover how the data is being fed back to them - allowing them to adjust their system accordingly. Thoughts? |
That's a very interesting point. I think the responsibility for pre-flight requests should fall to the developer, not be handled automatically by iBind. As you pointed out, we don't always know how the server works, and too many requests could get us IP-banned by IBKR. While iBind's automatic pre-flight handling is very, very convenient, it might be better to disable it by default, with an option to enable it when needed. |
Right, thanks for sharing your view on this. I think I agree, we shouldn't take care of this for users. I updated the WiKi to explain the pre-flight situation better. I think this is a responsible solution to the problem. Please have a look and let me know if anything could be modified there: https://github.com/Voyz/ibind/wiki/Advanced-REST#-pre-flight-requests |
Some endpoints require pre-flight requests. Can iBind handle these? I'm currently implementing a solution like this :
Is this the recommended approach?
The text was updated successfully, but these errors were encountered: