pub struct SynchronizerTaskHandle { /* private fields */ }Expand description
Handle for controlling a running synchronizer task.
This handle provides methods to gracefully shut down the synchronizer and await its completion with a timeout.
Implementations§
Source§impl SynchronizerTaskHandle
StateSynchronizer
impl SynchronizerTaskHandle
StateSynchronizer
Used to synchronize the state of a single protocol. The synchronizer is responsible for delivering messages to the client that let him reconstruct subsets of the protocol state.
This involves deciding which components to track according to the clients preferences, retrieving & emitting snapshots of components which the client has not seen yet and subsequently delivering delta messages for the components that have changed.
pub fn new(join_handle: JoinHandle<()>, close_tx: Sender<()>) -> Self
Sourcepub fn split(self) -> (JoinHandle<()>, Sender<()>)
pub fn split(self) -> (JoinHandle<()>, Sender<()>)
Splits the handle into its join handle and close sender.
This allows monitoring the task completion separately from controlling shutdown. The join handle can be used with FuturesUnordered for monitoring, while the close sender can be used to signal graceful shutdown.