summaryrefslogtreecommitdiffstats
path: root/futures/src/executor/thread_pool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'futures/src/executor/thread_pool.rs')
-rw-r--r--futures/src/executor/thread_pool.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/futures/src/executor/thread_pool.rs b/futures/src/executor/thread_pool.rs
new file mode 100644
index 00000000..1ec5bf69
--- /dev/null
+++ b/futures/src/executor/thread_pool.rs
@@ -0,0 +1,16 @@
+use crate::Executor;
+
+use futures::Future;
+
+/// A thread pool runtime for futures.
+pub type ThreadPool = futures::executor::ThreadPool;
+
+impl Executor for futures::executor::ThreadPool {
+ fn new() -> Result<Self, futures::io::Error> {
+ futures::executor::ThreadPool::new()
+ }
+
+ fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
+ self.spawn_ok(future);
+ }
+}