Skip to content

Commit

Permalink
comment on loop break
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Dec 9, 2024
1 parent 88ebcea commit 8acb7d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/grpc_subscription_autoreconnect_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub fn create_geyser_autoconnection_task_with_mpsc(
// read this for argument: http://www.randomhacks.net/2019/03/08/should-rust-channels-panic-on-send/

// task will be aborted when downstream receiver gets dropped
// there are two ways to terminate: 1) using break 'main_loop 2) return from task
let jh_geyser_task = tokio::spawn(async move {
let mut state = ConnectionState::NotConnected(1);
let mut messages_forwarded = 0;
Expand Down Expand Up @@ -220,7 +221,6 @@ pub fn create_geyser_autoconnection_task_with_mpsc(
ConnectionState::FatalError(_attempt, reason) => match reason {
FatalErrorReason::DownstreamChannelClosed => {
warn!("downstream closed - aborting");
// TODO break 'main_loop instead of returning
return;
}
FatalErrorReason::ConfigurationError => {
Expand Down Expand Up @@ -361,6 +361,7 @@ pub fn create_geyser_autoconnection_task_with_mpsc(
}
} // -- END match
} // -- state loop; break ONLY on graceful shutdown
debug!("gracefully exiting geyser task loop");
});

jh_geyser_task
Expand Down

0 comments on commit 8acb7d3

Please sign in to comment.