spawn connection futures directly onto runtime

This commit is contained in:
Dirkjan Ochtman
2020-09-29 17:07:30 +02:00
committed by Benjamin Fry
parent 3d600557c6
commit b75c4dd47e
2 changed files with 17 additions and 106 deletions

View File

@@ -7,9 +7,9 @@
use std::future::Future;
use trust_dns_resolver::proto::error::ProtoError;
use trust_dns_resolver::proto::Executor;
use trust_dns_resolver::error::ResolveError;
use trust_dns_resolver::name_server::{
GenericConnection, GenericConnectionProvider, RuntimeProvider, Spawn,
};
@@ -62,7 +62,7 @@ pub struct AsyncStdRuntimeHandle;
impl Spawn for AsyncStdRuntimeHandle {
fn spawn_bg<F>(&mut self, future: F)
where
F: Future<Output = Result<(), ResolveError>> + Send + 'static,
F: Future<Output = Result<(), ProtoError>> + Send + 'static,
{
let _join = async_std::task::spawn(future);
}