-
Notifications
You must be signed in to change notification settings - Fork 68
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
simple addon example via stremio-core + hyper #30
Comments
Unless Tide is more stable, we should go with Tower or Hyper; Actix-web might be an overkill and may be pretty unsafe |
This is a Tide version but it has problems:
|
there are new options to consider, namely hyper with futures 0.3 |
I'd like to put my two cents into this... Tide has changed a lot in the past few months. As of today I have to agree that it's still not ready for production yet, but it's getting close. It runs asynchronously using futures 0.3 and CORS will no longer be an issue when this PR gets merged. That being said, I messed around with your old example-addon using a feature version of tide and it turned out pretty well so far. Hyper is certainly a good choice too as it's gaining popularity and claims to be production ready, but I think you need to consider if you also need the HTTP client that comes with it? It probably depends; if you're sticking to an example addon that does a few basic API calls or something, sure. But if you're planning to extend it to a full SDK (referring to issue #11), I think it's better to leave the HTTP client of choice to the addon developer and keep the SDK crate as less bloated as possible. |
@sleeyax your SDK is very impressive, thank you for the contribution! re tide: I'm sure it's rapidly improving; I don't really have the knowledge to say which one is better for our goals, but we've used hyper before (the futures 0.1 versions), and we're using it in production right now - and we're very happy Also, having a http client is a good thing. But yes, keeping it out is a good call too. Since all of the dev effort is focused on delivering 5.0, we don't really have the time to develop a Rust SDK. If you feel yours is mature enough to build something (seems to me that it is), I suggest you submit a PR to add it to https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/examples.md and also to the README (I Suggest a "Rust version" paragraph under "Examples & tutorials", saying something like "There is a third-party Rust version built on stremio-core developed by sleeyax here"). |
Thanks :) I'd like to add a few more things and then I'll open that PR you suggested. |
we might not even need a full SDK: just using tower/actix/tide/hyper and getting a ResourceReq from the
req.url
will be mostly sufficient to make an addonTide: https://github.com/rustasync/tide/blob/master/examples/catch_all.rs
we can also make an example of a cloudflare worker: https://workers.cloudflare.com/docs/ ; this won't be using any server code, it just needs to be synchronous response building (use MetaItem/Stream/etc.)
The text was updated successfully, but these errors were encountered: