pub struct TransactionToolDispatcher { /* private fields */ }Expand description
Transaction-owned dispatcher: allowlist, validation, capacity, handler, output check.
Implementations§
Source§impl TransactionToolDispatcher
impl TransactionToolDispatcher
Sourcepub fn new(
transaction_id: TransactionId,
session_key: SessionKey,
tools: ResolvedToolSet,
shared_capacity: Arc<SharedToolCapacity>,
max_concurrent_tools: usize,
max_queued_tools: usize,
) -> Arc<Self> ⓘ
pub fn new( transaction_id: TransactionId, session_key: SessionKey, tools: ResolvedToolSet, shared_capacity: Arc<SharedToolCapacity>, max_concurrent_tools: usize, max_queued_tools: usize, ) -> Arc<Self> ⓘ
Build a dispatcher for one admitted transaction.
Sourcepub fn with_limits(
transaction_id: TransactionId,
session_key: SessionKey,
tools: ResolvedToolSet,
shared_capacity: Arc<SharedToolCapacity>,
limits: DispatcherLimits,
) -> Arc<Self> ⓘ
pub fn with_limits( transaction_id: TransactionId, session_key: SessionKey, tools: ResolvedToolSet, shared_capacity: Arc<SharedToolCapacity>, limits: DispatcherLimits, ) -> Arc<Self> ⓘ
Build with explicit concurrency and payload/output caps (D-015).
Sourcepub fn tools(&self) -> &ResolvedToolSet
pub fn tools(&self) -> &ResolvedToolSet
Resolved tool set (encoder / MCP projection).
Sourcepub fn transaction_id(&self) -> TransactionId
pub fn transaction_id(&self) -> TransactionId
Transaction identity.
Sourcepub fn session_key(&self) -> &SessionKey
pub fn session_key(&self) -> &SessionKey
Session key.
Sourcepub async fn dispatch(
self: &Arc<Self>,
request: DispatchRequest,
) -> DispatchOutcome
pub async fn dispatch( self: &Arc<Self>, request: DispatchRequest, ) -> DispatchOutcome
Dispatch one call end-to-end.
Sourcepub async fn dispatch_with_cancel(
self: &Arc<Self>,
request: DispatchRequest,
cancel: Option<Arc<Notify>>,
) -> DispatchOutcome
pub async fn dispatch_with_cancel( self: &Arc<Self>, request: DispatchRequest, cancel: Option<Arc<Notify>>, ) -> DispatchOutcome
Dispatch with an optional external cancel signal (D-028).
When cancel is notified, the dispatcher runs the same termination path as
an execution deadline so the worker is cancel/kill/joined instead of detached.
Auto Trait Implementations§
impl !RefUnwindSafe for TransactionToolDispatcher
impl !UnwindSafe for TransactionToolDispatcher
impl Freeze for TransactionToolDispatcher
impl Send for TransactionToolDispatcher
impl Sync for TransactionToolDispatcher
impl Unpin for TransactionToolDispatcher
impl UnsafeUnpin for TransactionToolDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more