Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

Commit

Permalink
Add graceful shutdown to TcpServer
Browse files Browse the repository at this point in the history
This commit prototypes support for graceful shutdown in `TcpServer`
through some new methods. A `TcpServer::bind` method was acced which is
used to construct a server and unlike `serve` returns the value
immediately.

The returned value can then be used to inspect the state of the server,
finally calling `run` to execute indefinitely or `run_until` to run
until a shutdown signal is received.
  • Loading branch information
alexcrichton committed Jan 26, 2017
1 parent 9e5aebb commit 71a3053
Show file tree
Hide file tree
Showing 2 changed files with 320 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ mod tcp_client;
pub use tcp_client::{TcpClient, Connect};

mod tcp_server;
pub use tcp_server::TcpServer;
pub use tcp_server::{TcpServer, TcpServerInstance};

use tokio_core::reactor::Handle;
use tokio_service::Service;
Expand Down
Loading

0 comments on commit 71a3053

Please sign in to comment.