pub struct AgentServer<H, S> { /* private fields */ }Expand description
Per-agent server that manages one agent’s serving lifecycle.
Implementations§
Source§impl<H, S> AgentServer<H, S>where
H: AsyncMessageHandler + Clone + Send + Sync + 'static,
S: AsyncTaskLifecycle + AsyncTaskQuery + AsyncNotificationManager + Clone + Send + Sync + 'static,
impl<H, S> AgentServer<H, S>where
H: AsyncMessageHandler + Clone + Send + Sync + 'static,
S: AsyncTaskLifecycle + AsyncTaskQuery + AsyncNotificationManager + Clone + Send + Sync + 'static,
Sourcepub fn new(config: AgentConfig, handler: Arc<H>, storage: Arc<S>) -> Self
pub fn new(config: AgentConfig, handler: Arc<H>, storage: Arc<S>) -> Self
Create a new agent server.
Sourcepub fn with_streaming(self, streaming: Arc<dyn AsyncStreamingHandler>) -> Self
pub fn with_streaming(self, streaming: Arc<dyn AsyncStreamingHandler>) -> Self
Attach a shared streaming backend.
Pass the same AsyncStreamingHandler instance the message handler
broadcasts to (clones of an InMemoryStreamingHandler share their
subscriber registry). The runtime injects it into the transport adapter
so tasks/subscribe SSE streams observe those broadcasts.
Sourcepub async fn start_http(&self) -> Result<(), ServerError>
pub async fn start_http(&self) -> Result<(), ServerError>
Start HTTP server
Sourcepub async fn run(self) -> Result<(), ServerError>
pub async fn run(self) -> Result<(), ServerError>
Start the appropriate server(s) based on configuration
Auto Trait Implementations§
impl<H, S> !RefUnwindSafe for AgentServer<H, S>
impl<H, S> !UnwindSafe for AgentServer<H, S>
impl<H, S> Freeze for AgentServer<H, S>
impl<H, S> Send for AgentServer<H, S>
impl<H, S> Sync for AgentServer<H, S>
impl<H, S> Unpin for AgentServer<H, S>
impl<H, S> UnsafeUnpin for AgentServer<H, S>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
Converts
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> ⓘ
Converts
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