-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Using hyper on non-Send Executors #2341
Comments
Yea, I wouldn't recommend implementing What you want to do should be possible, however. Have you seen the single threaded example: https://github.com/hyperium/hyper/blob/0.13.x/examples/single_threaded.rs |
I have, which is what inspired me to undertake this. Prior to that I was thinking it would just not be possible. The single threaded example passes an Let me share with you my snippet. I am creating a listener like this:
the If is don't force-mark the
My type, being Although I am not an expert on hyper (yet?), I have noticed that in the signature of
Which is why it fails. I may be missing something, but maybe this check is just too strict? If the types are not checked for Alternatively what I would propose is a |
Ah yes, the |
This works like a charm, thanks |
One more thing if I may - do you guys plan to publish a similar example to Reading the code I can't find any instance of |
The client does not have the same flexibility. We'd need to do to the |
Are there any examples of how to use hyper with gloomio while supporting h1 -> h2 upgrade? Edit: Added a new issue here: #3624 |
Hello Dear Friends,
I am interested in using your beautiful project in conjunction with https://github.com/DataDog/glommio/ instead of Tokio.
I know there are plenty of issues on how to use hyper with alternative executors, and I got that working just fine.
However, because glommio is a thread-per-core engine it requires that data doesn't leave a thread so our data structures are all
?Send
.Reading the code, it seems to me that the
Send
requirement arises only because the executor will requireSend
futures.Indeed, my simple examples work if I do this:
Where
HyperStream
andHyperListener
are our compat versions of the equivalent hyper data structures.Although that work, I don't feel very safe: it's too easy for someone to, in the future, trust the
Send
guarantees and use that data cross-thread in a way that would break my code.Tokio also has a local non-
Send
Executor so I am wondering if alternative versions of the API whereSend
is not a requirement would be welcome.I am willing to do the work to make that happen, but let's discuss it first
The text was updated successfully, but these errors were encountered: