chore: replace `futures::mpsc` with `tokio::mpsc` for Axum compatibility
I replaced futures::mpsc::UnboundedSender with tokio::sync::mpsc::UnboundedSender in the Axum server setup. The original sender doesn't implement Sync, which causes issues when used with axum::extract::State.
tokio::mpsc::UnboundedSender implements Clone + Send + Sync + 'static, making it a better fit here and removing the need to wrap the sender in Arc<Mutex<...>>. The fix makes the enqueue route work as intended without extra boilerplate.
@mdqst is attempting to deploy a commit to the unionbuild Team on Vercel.
A member of the Team first needs to authorize it.
thanks for the PR! was there an issue with the current design that this PR fixes? you mention Arc<Mutex<...>>, but we don't use that anywhere in the router.
Thanks for the feedback, benluelo! I encountered an issue when trying to use futures::mpsc::UnboundedSender with axum::extract::State, since the original sender does not implement Sync, which caused problems when working with multiple threads. Switching to tokio::sync::mpsc::UnboundedSender resolves this issue because it implements Sync, removing the need to wrap the sender in Arc<Mutex<...>>, as would be required with futures::mpsc. This change helps avoid potential concurrency issues and simplifies the code without introducing extra boilerplate.
I'm still not sure what problem you're trying to solve? The code works as it is right now.
closing this as it does not seem to solve anything.