pub struct NativeAsyncCoordinator { /* private fields */ }Implementations§
Source§impl NativeAsyncCoordinator
impl NativeAsyncCoordinator
Sourcepub async fn open(
journal: Box<dyn NativeAsyncJournal>,
executor: Arc<dyn NativeAsyncExecutor>,
max_concurrency: usize,
parallel_tool_calls: bool,
) -> Result<Self>
pub async fn open( journal: Box<dyn NativeAsyncJournal>, executor: Arc<dyn NativeAsyncExecutor>, max_concurrency: usize, parallel_tool_calls: bool, ) -> Result<Self>
Recover only after acquiring the journal’s exclusive ownership fence. Safe calls are reauthorized and restarted; unsafe calls become explicit interrupted outputs. Ambiguous HTTP delivery requires receipt recovery.
pub fn checkpoint(&self) -> &NativeAsyncCheckpoint
pub async fn persist_host_outcome(&mut self, outcome: Value) -> Result<()>
pub async fn release(&mut self) -> Result<()>
pub async fn register(&mut self, call: NativeToolCall) -> Result<()>
pub async fn begin_transcript_response( &mut self, message_id: String, ) -> Result<()>
pub async fn stage_transcript_result(&mut self, result: Value) -> Result<()>
pub async fn transcript_committed(&mut self, message_id: &str) -> Result<()>
Sourcepub async fn begin_response(&mut self) -> Result<()>
pub async fn begin_response(&mut self) -> Result<()>
Record request intent before a host opens its provider HTTP stream.
Sourcepub async fn next_response_event(
&mut self,
stream: &mut LlmResponseStream,
) -> Result<LlmStreamEvent>
pub async fn next_response_event( &mut self, stream: &mut LlmResponseStream, ) -> Result<LlmStreamEvent>
Drive jobs alongside one stream event, retaining call events for the host’s normal transcript pipeline. A completed response is not a turn end.
Sourcepub async fn pump(
&mut self,
stream: LlmResponseStream,
observe: impl FnMut(LlmStreamEvent),
) -> Result<()>
pub async fn pump( &mut self, stream: LlmResponseStream, observe: impl FnMut(LlmStreamEvent), ) -> Result<()>
Consume a response while jobs execute. Returns once the provider response
is complete, even if async work remains. Independent follow-up responses
may be pumped before waiting for jobs. observe receives prose/reasoning
unchanged; only executable call events are consumed by the coordinator.
Sourcepub async fn wait_next(&mut self) -> Result<bool>
pub async fn wait_next(&mut self) -> Result<bool>
Wait for one completion; outputs may be delivered out of launch order.
Sourcepub async fn prepare_delivery(&mut self) -> Result<Option<Delivery>>
pub async fn prepare_delivery(&mut self) -> Result<Option<Delivery>>
Persist the delivery intent before the caller submits its HTTP request. Synchronous calls must all finish before the provider can continue.
Source§impl NativeAsyncCoordinator
impl NativeAsyncCoordinator
Sourcepub async fn run<Request, RequestFuture>(
&mut self,
max_responses: usize,
request: Request,
observe: impl FnMut(LlmStreamEvent),
) -> Result<()>
pub async fn run<Request, RequestFuture>( &mut self, max_responses: usize, request: Request, observe: impl FnMut(LlmStreamEvent), ) -> Result<()>
Drive HTTP response continuations through completion, returning only when every accepted call’s output has a provider receipt. The caller supplies request construction; no transport or model defaults are chosen here.