Skip to content

Commit

Permalink
feat(client): add client::conn::Builder::executor method
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Nov 17, 2018
1 parent 3087002 commit 95446cc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::sync::Arc;

use bytes::Bytes;
use futures::{Async, Future, Poll};
use futures::future::{self, Either};
use futures::future::{self, Either, Executor};
use tokio_io::{AsyncRead, AsyncWrite};

use body::Payload;
Expand Down Expand Up @@ -441,6 +442,15 @@ impl Builder {
self
}

/// Provide an executor to execute background HTTP2 tasks.
pub fn executor<E>(&mut self, exec: E) -> &mut Builder
where
E: Executor<Box<Future<Item=(), Error=()> + Send>> + Send + Sync + 'static,
{
self.exec = Exec::Executor(Arc::new(exec));
self
}

pub(super) fn h1_writev(&mut self, enabled: bool) -> &mut Builder {
self.h1_writev = enabled;
self
Expand Down

0 comments on commit 95446cc

Please sign in to comment.