cyper-core 0.1.0-beta.2

Core adaptors and services for compio running on hyper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::future::Future;

use hyper::rt::Executor;

/// An executor service based on [`compio::runtime`]. It uses
/// [`compio::runtime::spawn`] interally.
#[derive(Debug, Default, Clone)]
pub struct CompioExecutor;

impl<F: Future<Output = ()> + Send + 'static> Executor<F> for CompioExecutor {
    fn execute(&self, fut: F) {
        compio::runtime::spawn(fut).detach();
    }
}