Skip to main content

spawn

Function spawn 

Source
pub fn spawn<A, T, F>(agent: A) -> AgentHandle<T>
where A: FnOnce(AgentContext<T>) -> F + Send + 'static, F: Future<Output = SageResult<T>> + Send, T: Send + 'static,
Expand description

Spawn an agent and return a handle to it.

The agent will run asynchronously in a separate task.