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

Graceful HTTP server shutdown #52

Merged
merged 3 commits into from
Jan 29, 2019
Merged

Graceful HTTP server shutdown #52

merged 3 commits into from
Jan 29, 2019

Conversation

jeromegn
Copy link
Member

This fixes #51

  • Intercepts SIGINT and SIGTERM
  • Tells the hyper server to gracefully stop (waits for current requests to finish, closes connections)
  • Disposes of each runtime currently running (eventually we could have an event in JS like "dispose")
  • Unifies both the non-TLS server and TLS server as just a stream of connections
  • Small fixups everywhere (rust 2018, small changes)

match sigrelaytx.send(()) {
Ok(_) => {}
Err(_) => {}
}; // don't care about result, do care about compiler warning...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use the ok() function on Result to ignore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! Nice.

@michaeldwan michaeldwan merged commit c1c7ff6 into master Jan 29, 2019
@michaeldwan michaeldwan deleted the graceful-shutdown branch January 29, 2019 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graceful shutdown of HTTP server
2 participants