Trait amiya::Executor [−][src]
Provide you custom async executor to Amiya by impl this trait.
Amiya instance will use it’s block_on
method when listen socket and use spawn
method to
start new request handler task.
See Amiya::executor()
.
Required methods
fn spawn<T: Send + 'static>(
&self,
future: impl Future<Output = T> + Send + 'static
)
[src]
&self,
future: impl Future<Output = T> + Send + 'static
)
Spawn a new task to your executor, let it run in background.
fn block_on<T>(&self, future: impl Future<Output = T>) -> T
[src]
Run a future until complete and returns it’s result.