Adds send bound to arbiter exec (#514)

Co-authored-by: James Bell <jamesbell@microsoft.com>
This commit is contained in:
jamescarterbell 2025-03-11 05:39:22 -04:00 committed by GitHub
parent e6a25db7ee
commit 8cfe0e50b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,7 +157,7 @@ impl Arbiter {
/// Send a function to the Arbiter's thread. This function will be executed asynchronously.
/// A future is created, and when resolved will contain the result of the function sent
/// to the Arbiters thread.
pub fn exec<F, R>(&self, f: F) -> impl Future<Output = Result<R, oneshot::RecvError>>
pub fn exec<F, R>(&self, f: F) -> impl Future<Output = Result<R, oneshot::RecvError>> + Send + 'static
where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,