Skip to content

Commit

Permalink
Make sure manager is Sync+Send (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw authored Jul 30, 2020
1 parent 254b630 commit 8e7ddc9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pubsub/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};

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

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

Expand Down Expand Up @@ -360,4 +360,11 @@ mod tests {

assert!(is_not_cancelled);
}

#[test]
fn is_send_sync() {
fn send_sync<T: Send + Sync>() {}

send_sync::<SubscriptionManager>();
}
}

0 comments on commit 8e7ddc9

Please sign in to comment.