mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
executor: add TypedExecutor (#993)
Adds a `TypedExecutor` trait that describes how to spawn futures of a specific type. This is useful for implementing functions that are generic over an executor and wish to support both `Send` and `!Send` cases.
This commit is contained in:
@@ -2,10 +2,11 @@ extern crate futures;
|
||||
extern crate tokio_executor;
|
||||
|
||||
use futures::{future::lazy, Future};
|
||||
use tokio_executor::*;
|
||||
use tokio_executor::DefaultExecutor;
|
||||
|
||||
mod out_of_executor_context {
|
||||
use super::*;
|
||||
use tokio_executor::Executor;
|
||||
|
||||
fn test<F, E>(spawn: F)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user