Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Service::call doesn't seem to implement Send trait bound #9

Closed
GlenDC opened this issue Jul 27, 2023 · 2 comments
Closed

Service::call doesn't seem to implement Send trait bound #9

GlenDC opened this issue Jul 27, 2023 · 2 comments

Comments

@GlenDC
Copy link
Member

GlenDC commented Jul 27, 2023

Code such as the following pseudo code:

let service = make_service();
tokio::spawn(async move {
     let _ = service.call(req).await;
});

Currently doesn't compile, complaining that the Future generated for service::call call, does currently not implement Send, which is a requirement here, given we expect it to be Send for it to compile in a higher order fn.

GlenDC pushed a commit to plabayo/rama that referenced this issue Jul 27, 2023
a bit of a hack to for now not require send bounds
for service async call fns

this until we find a fix for
plabayo/tower-async#9
@GlenDC
Copy link
Member Author

GlenDC commented Jul 27, 2023

Turns out to be a bug in the trait resolver. Which will be solved once that is complete.
Using turbo fish syntax is for now how one can get around it.

Cfr: rust-lang/rust#114142 (comment)

@GlenDC
Copy link
Member Author

GlenDC commented Jul 27, 2023

This issue can be closed as-is, given there's not much we can do or have to do, except to wait.
For now tower-async users can make use of the "tubofish" syntax to get around it.

@GlenDC GlenDC closed this as completed Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant