-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Error when using other Tower Service with Poem #536
Comments
From my research I feel like making the upstream code return Services that impl Sync is not correct, the changes should be made in the Poem layer. As it is now, it is pretty hard to use any other Service with Poem due to this constraint. |
I can see a possible solution in the Tonic side too: hyperium/tonic#1322. |
Of course if we had #535, this could be solved the other way around, where instead of Poem at the top, we have something else like Axum or Tower directly, and then Poem and Tonic underneath it. |
For context, this problem makes it that the only solution is to run two separate web servers and then have a reverse proxy (on the same machine) in front of them. |
See this code:
Here you can see I define a service using tonic, convert it into a tower service, and then apply
.compat()
to it to make it compatible with Poem. Unfortunately, this isn't working: https://gist.github.com/banool/52c92650a00b6ac2d7322e1220ac9588. It seems like Poem requires that the service be Sync, but the one produced by Tonic is not.Is there any way I can make this work?
The text was updated successfully, but these errors were encountered: