Skip to content
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

Open
Ivshti opened this issue May 19, 2019 · 6 comments
Open

simple addon example via stremio-core + hyper #30

Ivshti opened this issue May 19, 2019 · 6 comments
Assignees

Comments

@Ivshti
Copy link
Member

Ivshti commented May 19, 2019

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 addon

Tide: 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.)

@Ivshti Ivshti changed the title simple addon example via stremio-core + tower/actix simple addon example via stremio-core + tower/actix/tide May 24, 2019
@Ivshti
Copy link
Member Author

Ivshti commented Jul 17, 2019

Unless Tide is more stable, we should go with Tower or Hyper; Actix-web might be an overkill and may be pretty unsafe

@Ivshti Ivshti changed the title simple addon example via stremio-core + tower/actix/tide simple addon example via stremio-core + tower/tide Jul 17, 2019
@Ivshti Ivshti added this to the v1.0 milestone Jul 27, 2019
@Ivshti Ivshti self-assigned this Aug 25, 2019
@Ivshti
Copy link
Member Author

Ivshti commented Aug 25, 2019

This is a Tide version but it has problems:

https://github.com/Ivshti/stremio-addon

@Ivshti
Copy link
Member Author

Ivshti commented Jan 3, 2020

there are new options to consider, namely hyper with futures 0.3

@Ivshti Ivshti modified the milestones: v1.0, v1.1 Jan 3, 2020
@Ivshti Ivshti changed the title simple addon example via stremio-core + tower/tide simple addon example via stremio-core + hyper Jan 3, 2020
@sleeyax
Copy link
Member

sleeyax commented Jan 3, 2020

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.

@Ivshti
Copy link
Member Author

Ivshti commented Jan 4, 2020

@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").

@sleeyax
Copy link
Member

sleeyax commented Jan 4, 2020

@Ivshti

Thanks :)

I'd like to add a few more things and then I'll open that PR you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants