tokio-rs / tokio-service

The core `Service` trait in Tokio and support
Apache License 2.0
82 stars 19 forks source link

Make NewService return a future. #22

Closed withoutboats closed 6 years ago

withoutboats commented 7 years ago

Previous, NewService returns a Result, which doesn't work for client services which may need to establish a TCP connection.

Change NewService to return a Future. The previous impl of NewService for Fn() -> Result is made more general, to an Fn() -> IntoFuture.

This is a breaking change.

carllerche commented 7 years ago

Again, like w/ the other PRs, we're going to want to figure out how to best coordinate releasing this work.