reth_engine_tree::engine

Trait EngineRequestHandler

Source
pub trait EngineRequestHandler: Send + Sync {
    type Event: Send;
    type Request;
    type Block: Block;

    // Required methods
    fn on_event(&mut self, event: FromEngine<Self::Request, Self::Block>);
    fn poll(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<RequestHandlerEvent<Self::Event>>;
}
Expand description

A type that processes incoming requests (e.g. requests from the consensus layer, engine API, such as newPayload).

§Control flow

Requests and certain updates, such as a change in backfill sync status, are delegated to this type via EngineRequestHandler::on_event. This type is responsible for processing the incoming requests and advancing the chain and emit events when it is polled.

Required Associated Types§

Source

type Event: Send

Event type this handler can emit

Source

type Request

The request type this handler can process.

Source

type Block: Block

Type of the block sent in FromEngine::DownloadedBlocks variant.

Required Methods§

Source

fn on_event(&mut self, event: FromEngine<Self::Request, Self::Block>)

Informs the handler about an event from the EngineHandler.

Source

fn poll( &mut self, cx: &mut Context<'_>, ) -> Poll<RequestHandlerEvent<Self::Event>>

Advances the handler.

Implementors§

Source§

impl<Request, N: NodePrimitives> EngineRequestHandler for EngineApiRequestHandler<Request, N>
where Request: Send,

Source§

type Event = BeaconConsensusEngineEvent<N>

Source§

type Request = Request

Source§

type Block = <N as NodePrimitives>::Block