pub trait Runtime:
Send
+ Sync
+ 'static {
// Required method
fn spawn<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WorkerHandle>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Spawns workers per a runtime-specific strategy.
Required Methods§
Sourcefn spawn<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WorkerHandle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WorkerHandle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spawn a single worker and return a handle.
The handle’s task and control sockets must be ready: a subsequent
recv_control is expected to yield control.ready within the boot
timeout (enforced by the pool, not the runtime).