Trait reth_engine_tree::engine::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