Skip to content

Commit 8e7ddc9

Browse files
authored
Make sure manager is Sync+Send (#573)
1 parent 254b630 commit 8e7ddc9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pubsub/src/manager.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use rand::distributions::Alphanumeric;
3434
use rand::{thread_rng, Rng};
3535

3636
/// Cloneable `Spawn` handle.
37-
pub type TaskExecutor = Arc<dyn futures::task::Spawn>;
37+
pub type TaskExecutor = Arc<dyn futures::task::Spawn + Send + Sync>;
3838

3939
type ActiveSubscriptions = Arc<Mutex<HashMap<SubscriptionId, oneshot::Sender<()>>>>;
4040

@@ -360,4 +360,11 @@ mod tests {
360360

361361
assert!(is_not_cancelled);
362362
}
363+
364+
#[test]
365+
fn is_send_sync() {
366+
fn send_sync<T: Send + Sync>() {}
367+
368+
send_sync::<SubscriptionManager>();
369+
}
363370
}

0 commit comments

Comments
 (0)