Module buffered_link

Source
Expand description

Provides the buffered_link utility.

The buffered link is a channel that allows buffering the method calls on Link.

§Example

use sc_consensus::import_queue::Link;
let (mut tx, mut rx) = buffered_link::<Block>(100_000);
tx.blocks_processed(0, 0, vec![]);

// Calls `my_link.blocks_processed(0, 0, vec![])` when polled.
let _fut = futures::future::poll_fn(move |cx| {
	rx.poll_actions(cx, &my_link).unwrap();
	std::task::Poll::Pending::<()>
});

Structs§

BufferedLinkReceiver
See buffered_link.
BufferedLinkSender
See buffered_link.

Enums§

BlockImportWorkerMsg
Internal buffered message.

Functions§

buffered_link
Wraps around an unbounded channel from the futures crate. The sender implements Link and can be used to buffer commands, and the receiver can be used to poll said commands and transfer them to another link. queue_size_warning sets the warning threshold of the channel queue size.