Skip to main content

CallbackInvoker

Trait CallbackInvoker 

Source
pub trait CallbackInvoker {
    type Error;

    // Required method
    fn invoke(
        &self,
        plan: &RoutingPlan,
        payloads: &[PayloadEnvelope],
    ) -> Result<CallbackResponse, Self::Error>;
}
Expand description

Callback invocation seam.

Implemented by DefaultCallbackInvoker (in-process, callbacks.rs) and SubprocessCallbackInvoker (process boundary, subprocess.rs). The signature takes a RoutingPlan plus the optional PayloadEnvelopes the caller is delivering and lets the implementation destructure, so the seam stays free of any protocol dependency.

The PayloadEnvelope::body is treated as opaque bytes/value — implementations must not parse it.

Required Associated Types§

Source

type Error

Error produced by the callback transport. Kept generic so the in-process and subprocess impls (and any future network impl) can each carry their own diagnostic shape.

Required Methods§

Source

fn invoke( &self, plan: &RoutingPlan, payloads: &[PayloadEnvelope], ) -> Result<CallbackResponse, Self::Error>

Invoke the client callback for a routed event.

payloads carries any PayloadEnvelopes the caller is delivering alongside the event. The router does not inspect payload bodies; the invoker may, but is not required to.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§