pub struct LambdaA2aServerBuilder { /* private fields */ }Expand description
Builder for Lambda A2A handler.
Use .storage(my_storage) to supply a single backend implementing all storage traits.
This satisfies ADR-009’s same-backend requirement and enables streaming via durable
event store.
For push-notification delivery, wire .storage() with a backend that implements
A2aPushDeliveryStore (all four first-party backends do). The atomic store
must also opt in via with_push_dispatch_enabled(true) (ADR-013 §4.3); the
builder rejects configurations where the flag and the delivery store disagree.
Implementations§
Source§impl LambdaA2aServerBuilder
impl LambdaA2aServerBuilder
pub fn new() -> Self
pub fn executor(self, exec: impl AgentExecutor + 'static) -> Self
Sourcepub fn storage<S>(self, storage: S) -> Selfwhere
S: A2aTaskStorage + A2aPushNotificationStorage + A2aEventStore + A2aAtomicStore + A2aCancellationSupervisor + Clone + 'static,
pub fn storage<S>(self, storage: S) -> Selfwhere
S: A2aTaskStorage + A2aPushNotificationStorage + A2aEventStore + A2aAtomicStore + A2aCancellationSupervisor + Clone + 'static,
Set all storage from a single backend instance.
This is the preferred method — a single struct implementing all storage traits guarantees the same-backend requirement (ADR-009) AND ensures the cancellation supervisor reads the same backend the cancel marker is written to. A mismatch here (e.g., DynamoDB task storage + in-memory cancellation supervisor) silently breaks cross-instance cancellation.
ADR-013 §4.3 errata: .storage() wires storage traits only. It does
not auto-register the storage as a push-delivery store, even if
the backend happens to implement A2aPushDeliveryStore. To opt in
to push delivery, call Self::push_delivery_store explicitly and
call with_push_dispatch_enabled(true) on the storage instance
before passing it here. Non-push deployments need neither.
Sourcepub fn task_storage(self, s: impl A2aTaskStorage + 'static) -> Self
pub fn task_storage(self, s: impl A2aTaskStorage + 'static) -> Self
Set task storage individually. Must be paired with event_store/atomic_store
AND cancellation_supervisor() for same-backend compliance.
Sourcepub fn push_storage(self, s: impl A2aPushNotificationStorage + 'static) -> Self
pub fn push_storage(self, s: impl A2aPushNotificationStorage + 'static) -> Self
Set push notification storage individually.
Sourcepub fn event_store(self, s: impl A2aEventStore + 'static) -> Self
pub fn event_store(self, s: impl A2aEventStore + 'static) -> Self
Set event store individually. Must match task_storage backend.
Sourcepub fn atomic_store(self, s: impl A2aAtomicStore + 'static) -> Self
pub fn atomic_store(self, s: impl A2aAtomicStore + 'static) -> Self
Set atomic store individually. Must match task_storage backend.
Sourcepub fn cancellation_supervisor(
self,
s: impl A2aCancellationSupervisor + 'static,
) -> Self
pub fn cancellation_supervisor( self, s: impl A2aCancellationSupervisor + 'static, ) -> Self
Set the cancellation supervisor individually. Must match
task_storage backend — otherwise :cancel writes the marker to
one backend and the supervisor reads from another, silently
breaking cross-instance cancellation. Prefer .storage() for
unified wiring. Consumed by core_cancel_task (ADR-012).
Sourcepub fn push_delivery_store(
self,
store: impl A2aPushDeliveryStore + 'static,
) -> Self
pub fn push_delivery_store( self, store: impl A2aPushDeliveryStore + 'static, ) -> Self
Set the push delivery store individually (ADR-011 §10 / ADR-013).
Prefer .storage() for unified wiring. The delivery store MUST
be on the same backend as .task_storage(...) — the builder
rejects mismatches. Passing a delivery store also requires the
atomic store to have opted in via with_push_dispatch_enabled(true)
(ADR-013 §4.3).
Sourcepub fn runtime_config(self, cfg: RuntimeConfig) -> Self
pub fn runtime_config(self, cfg: RuntimeConfig) -> Self
Override the runtime configuration (timeouts, retry budgets,
push tuning). Defaults to RuntimeConfig::default(). The
builder validates push settings (claim expiry vs retry horizon,
ADR-011 §10.3) when .push_delivery_store(...) is wired.