poem-web / poem

A full-featured and easy-to-use web framework with the Rust programming language.
Apache License 2.0
3.62k stars 295 forks source link

Remove Sync bound on services #542

Open banool opened 1 year ago

banool commented 1 year ago

Description of the feature

As part of trying to get Poem to work with other Tower services, I ran into this issue where most other Tower based projects, like Tower itself, Tonic, etc, do not produce a Service that is Sync. In this discussion, a Tonic maintainer mentions that previously Tonic had this bound too, but found it to be unnecessary. The discussion: https://github.com/hyperium/tonic/issues/1322.

Would it be possible to rebuild Poem to remove the Sync bound requirement? From what I've read of the code, it is currently Sync to enable some middleware, so I realize this might be a big change to make.

banool commented 1 year ago

I think this is the solution to https://github.com/poem-web/poem/issues/536 btw.