Skip to content

Commit

Permalink
feat(server): remove unneeded Send + Sync from Server
Browse files Browse the repository at this point in the history
Http and Server placed Send + Sync bounds on NewService implementations which
were not actually required given tokio's event loop model. Remove them to reduce
limitations on end users of hyper.
  • Loading branch information
spinda authored and seanmonstar committed Sep 22, 2017
1 parent 0c7d375 commit 16e834d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl<B: AsRef<[u8]> + 'static> Http<B> {
/// The returned `Server` contains one method, `run`, which is used to
/// actually run the server.
pub fn bind<S, Bd>(&self, addr: &SocketAddr, new_service: S) -> ::Result<Server<S, Bd>>
where S: NewService<Request = Request, Response = Response<Bd>, Error = ::Error> +
Send + Sync + 'static,
where S: NewService<Request = Request, Response = Response<Bd>, Error = ::Error> + 'static,
Bd: Stream<Item=B, Error=::Error>,
{
let core = try!(Core::new());
Expand Down Expand Up @@ -378,8 +377,7 @@ impl<T, B> Service for HttpService<T>
}

impl<S, B> Server<S, B>
where S: NewService<Request = Request, Response = Response<B>, Error = ::Error>
+ Send + Sync + 'static,
where S: NewService<Request = Request, Response = Response<B>, Error = ::Error> + 'static,
B: Stream<Error=::Error> + 'static,
B::Item: AsRef<[u8]>,
{
Expand Down

0 comments on commit 16e834d

Please sign in to comment.