Skip to content

Commit 71de1bd

Browse files
committed
Also move the subscriber into a separate task, otherwise it will never run since the reflector looping forever
Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
1 parent e161079 commit 71de1bd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

kube-runtime/src/utils/watch_ext.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ pub trait WatchStreamExt: Stream {
238238
/// }
239239
/// });
240240
///
241+
/// tokio::spawn(async move {
242+
/// // subscriber can be used to receive applied_objects
243+
/// subscriber.for_each(|obj| async move {
244+
/// info!("saw in subscriber {}", &obj.name_any())
245+
/// }).await;
246+
/// });
247+
///
241248
/// // configure the watcher stream and populate the store while polling
242249
/// watcher(deploys, watcher::Config::default())
243250
/// .reflect_shared(writer)
@@ -250,11 +257,6 @@ pub trait WatchStreamExt: Stream {
250257
/// })
251258
/// .await;
252259
///
253-
/// // subscriber can be used to receive applied_objects
254-
/// subscriber.for_each(|obj| async move {
255-
/// info!("saw in subscriber {}", &obj.name_any())
256-
/// }).await;
257-
///
258260
/// # Ok(())
259261
/// # }
260262
/// ```

0 commit comments

Comments
 (0)