pub trait SlotWorker<B: BlockT> {
    type OnSlot: Future<Output = Option<SlotResult<B>>>;
    fn on_slot(
        &mut self,
        chain_head: B::Header,
        slot_info: SlotInfo
    ) -> Self::OnSlot; }
Expand description

A worker that should be invoked at every new slot.

The implementation should not make any assumptions of the slot being bound to the time or similar. The only valid assumption is that the slot number is always increasing.

Associated Types

The type of the future that will be returned when a new slot is triggered.

Required methods

Called when a new slot is triggered.

Returns a future that resolves to a SlotResult iff a block was successfully built in the slot. Otherwise None is returned.

Implementors