Module sc_consensus::import_queue::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, &mut my_link);
std::task::Poll::Pending::<()>
});
Structs§
- See
buffered_link
. - See
buffered_link
.
Enums§
- Internal buffered message.
Functions§
- Wraps around an unbounded channel from the
futures
crate. The sender implementsLink
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.