pub struct Runtime<'a, S> { /* private fields */ }
Expand description
Implementations§
source§impl<'a> Runtime<'a, SmolScheduler>
impl<'a> Runtime<'a, SmolScheduler>
sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new Runtime using SmolScheduler::default() for the Scheduler.
pub fn with_custom_routes(routes: Router) -> Self
source§impl<'a, S: Scheduler> Runtime<'a, S>
impl<'a, S: Scheduler> Runtime<'a, S>
sourcepub fn with_scheduler(scheduler: S) -> Self
pub fn with_scheduler(scheduler: S) -> Self
pub fn with_config(scheduler: S, routes: Router) -> Self
pub fn spawn<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
) -> Task<T> ⓘ
pub fn block_on<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
) -> T
pub fn spawn_background<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
)
pub fn spawn_blocking<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
) -> Task<T> ⓘ
pub fn spawn_blocking_background<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
)
pub async fn start<'b>(
&'a self,
fg: Flowgraph
) -> (TaskHandle<'b, Result<Flowgraph>>, FlowgraphHandle)where
'a: 'b,
sourcepub fn run(&self, fg: Flowgraph) -> Result<Flowgraph>
pub fn run(&self, fg: Flowgraph) -> Result<Flowgraph>
Main method that kicks-off the running of a Flowgraph.