Module sc_consensus::import_queue::buffered_link[][src]

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>();
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, &mut my_link);
	std::task::Poll::Pending::<()>
});

Structs

Functions

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.