tower-rs / tower

async fn(Request) -> Result<Response, Error>
https://docs.rs/tower
MIT License
3.56k stars 281 forks source link

Add `BoxCloneSyncService` #770

Open tthebst opened 5 months ago

tthebst commented 5 months ago

Currently BoxCloneService does not implement Sync even though the inner Service implements Sync. This can be solved by adding a Sync bound to the inner service bounds.

Other projects such as axum also have this just internally. Might be worth adding it upstream.

I would be willing to submit a PR for this.

tobz commented 4 months ago

@tthebst Yeah, looking at what axum does... it seems like that ought to be fine.

If you're willing to submit a PR, that'd be great.

GlenDC commented 4 months ago

If you no longer can pick this work up @tthebst in the next weeks do let us know. I can take it over if you wish. Otherwise I’ll leave it with pleasure for you to do, given it was your proposal :)

alekseysidorov commented 1 month ago

If you want to use this functionality, I have added it to my crate.