wip: implemented incoming-like body for asynchronous operation in http/3
This commit is contained in:
parent
1dc88ce056
commit
4b6f63e09f
11 changed files with 376 additions and 68 deletions
23
rpxy-lib/src/hyper_ext/executor.rs
Normal file
23
rpxy-lib/src/hyper_ext/executor.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use tokio::runtime::Handle;
|
||||
|
||||
#[derive(Clone)]
|
||||
/// Executor for hyper
|
||||
pub struct LocalExecutor {
|
||||
runtime_handle: Handle,
|
||||
}
|
||||
|
||||
impl LocalExecutor {
|
||||
pub fn new(runtime_handle: Handle) -> Self {
|
||||
LocalExecutor { runtime_handle }
|
||||
}
|
||||
}
|
||||
|
||||
impl<F> hyper::rt::Executor<F> for LocalExecutor
|
||||
where
|
||||
F: std::future::Future + Send + 'static,
|
||||
F::Output: Send,
|
||||
{
|
||||
fn execute(&self, fut: F) {
|
||||
self.runtime_handle.spawn(fut);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue