reth_engine_tree::engine

Trait EngineRequestHandler

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

    // Required methods
    fn on_event(&mut self, event: FromEngine<Self::Request>);
    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.

Required Methods§

Source

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

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> EngineRequestHandler for EngineApiRequestHandler<Request>
where Request: Send,

Source§

type Event = BeaconConsensusEngineEvent

Source§

type Request = Request