axum icon indicating copy to clipboard operation
axum copied to clipboard

Enforce Sync for inner services and handlers

Open jplatte opened this issue 3 years ago • 3 comments

Motivation: Makes Router and RouterService Sync.

The box_clone_sync_service is copied from tower and adjusted to include Sync, none of the docs since it is private. It could probably be upstreamed into tower if we decide that we want this.

jplatte avatar Oct 13 '22 13:10 jplatte

I'm a little afraid of this since we used to require Sync in the past but reverted it because it broke other stuff (https://github.com/tokio-rs/axum/pull/273). At least requires a bunch of testing with real projects that uses axum to see the impact.

davidpdrsn avatar Oct 13 '22 13:10 davidpdrsn

Yeah I agree this needs extra testing. After the coming rc.3, I can port a few things to that first, to then see whether this commit works equally well.

jplatte avatar Oct 13 '22 13:10 jplatte

I'll also test it with our stuff at Embark.

davidpdrsn avatar Oct 13 '22 13:10 davidpdrsn

Putting this on the 0.7 milestone. I'm reluctant to increase the scope of 0.6 now.

davidpdrsn avatar Nov 18 '22 11:11 davidpdrsn

Rebased. Hope you find some time to test it, I'm probably not available for that at least for a few weeks.

jplatte avatar Nov 29 '22 14:11 jplatte

I've added this to the todo list for 0.7 but probably easier to redo it there rather than trying to rebase it given all the changes. I'll close this for now but still think it's something we should consider for 0.7.

davidpdrsn avatar Mar 10 '23 10:03 davidpdrsn