pub struct AgentDispatcher {
peers: Arc<dyn WorkspaceFacade>,
workers: Arc<dyn WorkerFacade>,
}Expand description
The two engines, both held: a target inside the caller’s project is served by the workers engine and one outside it by the peers engine. Keeping both is what makes this a dispatcher rather than a third implementation.
Fields§
§peers: Arc<dyn WorkspaceFacade>§workers: Arc<dyn WorkerFacade>Implementations§
Source§impl AgentDispatcher
impl AgentDispatcher
pub fn new( peers: Arc<dyn WorkspaceFacade>, workers: Arc<dyn WorkerFacade>, ) -> Self
Sourcepub fn peers(&self) -> &Arc<dyn WorkspaceFacade> ⓘ
pub fn peers(&self) -> &Arc<dyn WorkspaceFacade> ⓘ
The cross-project engine, for listing configured projects and reading the caller’s own identity.
Sourcepub fn workers(&self) -> &Arc<dyn WorkerFacade> ⓘ
pub fn workers(&self) -> &Arc<dyn WorkerFacade> ⓘ
The in-project engine, for the caller’s own workers and every worker lifecycle verb.
Sourcepub async fn deliver(
&self,
caller: &SessionSlot,
target: &AgentTarget,
wrapped: WrappedPrompt,
) -> Result<(), String>
pub async fn deliver( &self, caller: &SessionSlot, target: &AgentTarget, wrapped: WrappedPrompt, ) -> Result<(), String>
Hand wrapped to target’s seat. The engine’s own answer is
whether the message was accepted, not whether it was read, so a
success says nothing more than that.
Three of the four paths are the ones the two families already had, unchanged. The fourth is the reach the merge adds: a worker address in another project, which the peers engine cannot serve because it resolves a project to that project’s own agent.
async fn deliver_within_own_project( &self, caller: &SessionSlot, target: &AgentTarget, wrapped: WrappedPrompt, ) -> Result<(), String>
Auto Trait Implementations§
impl !RefUnwindSafe for AgentDispatcher
impl !UnwindSafe for AgentDispatcher
impl Freeze for AgentDispatcher
impl Send for AgentDispatcher
impl Sync for AgentDispatcher
impl Unpin for AgentDispatcher
impl UnsafeUnpin for AgentDispatcher
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more