You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't remember if the Send trait is needed. I assume it was added to make something else happy, if you wanted to try to remove it and see if the library still compiles...
I don't remember if the Send trait is needed. I assume it was added to make something else happy, if you wanted to try to remove it and see if the library still compiles...
I had to remove + Send all around the place and even disable some code (e.g. warp server stuff) to make it compile without Send, so I am enclines to say there is no easy way to use warp with a single-threaded executor and a !Send state.
I'm am running warp as a service with a single-threaded hyper server.
The setup is based on:
https://github.com/hyperium/hyper/blob/0.14.x/examples/single_threaded.rs
which allows to use a state shared through an Rc pointer.
I am trying to port the warp todos example in this setup, with an Rc/Refcell because Arc is not needed, and I cannot because this line:
warp/examples/todos.rs
Line 100 in 4e9c4fd
creates a Map filter which does not implement warp::filter::FilterBase, because warp's implementation requires to use Send closures:
(see the Send trait on the last line - taken from https://github.com/seanmonstar/warp/blob/master/src/filter/map.rs).
It is so frustrating to use sync primitives (Arc / Mutex) when they are not needed!
Is there any workaround? Is the Send trait necessary there?
The text was updated successfully, but these errors were encountered: