-
Notifications
You must be signed in to change notification settings - Fork 37
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
Adding support for crypto streaming #56
Comments
Please see #26. I haven't looked into crypto support much. |
If you want to give it a shot, be my guest. I suppose what you are saying is that |
This is the relevant code from stream.rs let ApiInfo {
data_stream_base_url: url,
key_id,
secret,
..
} = api_info;
let mut url = url.clone();
url.set_path(&format!("v2/{}", S::as_str())); I think that manipulating the url inside stream.rs/subscribe is the cause of the problem to easily add / manipulate sources.
what do you think? |
That will be less user-friendly, though, because now users have to fiddle around with stream URL endpoints. That will probably result in a messy situation, like here: #51 (comment) Crypto streaming is all beta stuff from what I understand. I am reluctant to include anything beta in this crate -- Alpaca can't even provide stable "stable" APIs, so I am not putting up with anything openly declared unstable. That's also the reason why there is no So I don't think crypto will end up receiving first class support. That being said, I think one avenue we have is to go with a mixture of what you propose:
Of course I papered over a bunch of implementation details here that I haven't thought through in detail. Specifically, as you said currently |
The idea meks sense and I understand why you prefer it that way. But I just to say that I think it's important crypto will get a first class support as it makes developing much faster - because it's streaming 24/7. I for example don't plan to trade crypto but I want to develop using crypto then switch and test on stocks. For me waiting hours to test my program is unacceptable, that's why I offered to PR. I guess for others too. If you agree, than let's do the second option and have a Crypto source, and make everything work seamlessly from there. I can do them both you choose |
If the URL is in the |
And if we do that we are back at enabling some beta stuff, right, which I mentioned is something I'd rather not do :-| |
Hey!
from what I've tried the repo does not support crypto streaming, that is due to a different path structure from the regular streaming api.
I think it's very important, because you can trade crypto 24/7 so you don't need to wait for market open times to test your code.
I'm new to rust, but I think I know how to change that, and if I'll get some timely support I can work on a PR for that.
basically start by making the Source trait return the URL instead of the STR, than incorporate that to ApiInfo.
The text was updated successfully, but these errors were encountered: