summaryrefslogtreecommitdiffstats
path: root/futures/src/subscription/tracker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'futures/src/subscription/tracker.rs')
-rw-r--r--futures/src/subscription/tracker.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs
index 277a446b..086b0f09 100644
--- a/futures/src/subscription/tracker.rs
+++ b/futures/src/subscription/tracker.rs
@@ -1,4 +1,5 @@
use crate::core::event::{self, Event};
+use crate::core::window;
use crate::subscription::{Hasher, Recipe};
use crate::{BoxFuture, MaybeSend};
@@ -23,7 +24,9 @@ pub struct Tracker {
#[derive(Debug)]
pub struct Execution {
_cancel: futures::channel::oneshot::Sender<()>,
- listener: Option<futures::channel::mpsc::Sender<(Event, event::Status)>>,
+ listener: Option<
+ futures::channel::mpsc::Sender<(Event, event::Status, window::Id)>,
+ >,
}
impl Tracker {
@@ -139,12 +142,19 @@ impl Tracker {
/// currently open.
///
/// [`Recipe::stream`]: crate::subscription::Recipe::stream
- pub fn broadcast(&mut self, event: Event, status: event::Status) {
+ pub fn broadcast(
+ &mut self,
+ event: Event,
+ status: event::Status,
+ window: window::Id,
+ ) {
self.subscriptions
.values_mut()
.filter_map(|connection| connection.listener.as_mut())
.for_each(|listener| {
- if let Err(error) = listener.try_send((event.clone(), status)) {
+ if let Err(error) =
+ listener.try_send((event.clone(), status, window))
+ {
log::warn!(
"Error sending event to subscription: {error:?}"
);