MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / execute_streaming

Method execute_streaming

core/src/workflow.rs:374–384  ·  view source on GitHub ↗

Execute a workflow with real-time streaming events. Identical to [`execute`] but emits [`StreamEvent`]s through `event_tx` at every node boundary. The caller consumes events from the corresponding `mpsc::Receiver` while this future runs (typically in a spawned task). # Arguments `workflow` — the workflow to execute `guardrail_enforcer` — optional PII masking enforcer `event_tx` — sender half of

(
        &self,
        workflow: Workflow,
        guardrail_enforcer: Option<Arc<Enforcer>>,
        event_tx: tokio::sync::mpsc::Sender<crate::stream::StreamEvent>,
        stream_mode: crate::str

Source from the content-addressed store, hash-verified

372 /// If the receiver is dropped (e.g. the caller stops iterating early),
373 /// send failures are silently ignored — the workflow still runs to completion.
374 pub async fn execute_streaming(
375 &self,
376 workflow: Workflow,
377 guardrail_enforcer: Option<Arc<Enforcer>>,
378 event_tx: tokio::sync::mpsc::Sender<crate::stream::StreamEvent>,
379 stream_mode: crate::stream::StreamMode,
380 ) -> GraphBitResult<WorkflowContext> {
381 let context = WorkflowContext::new(workflow.id.clone());
382 self.execute_internal(workflow, guardrail_enforcer, Some(event_tx), stream_mode, context)
383 .await
384 }
385
386 /// Shared execution engine used by both [`execute`] and [`execute_streaming`].
387 ///

Calls 2

cloneMethod · 0.80
execute_internalMethod · 0.80