hotstuff_rs::networking::receiving

Function start_polling

source
pub(crate) fn start_polling<N: Network + 'static>(
    network: N,
    shutdown_signal: Receiver<()>,
) -> (JoinHandle<()>, Receiver<(VerifyingKey, ProgressMessage)>, Receiver<(VerifyingKey, BlockSyncRequest)>, Receiver<(VerifyingKey, BlockSyncResponse)>)
Expand description

Spawn the poller thread, which polls the Network for messages and distributes them into receivers for:

  1. Progress messages (processed by the Algorithm’s execute loop), and
  2. Block sync requests (processed by BlockSyncServer), and
  3. Block sync responses (processed by BlockSyncClient).