braintree/manners — pull request #22 by gwatts (2014-08-19 03:20:51+00:00)
Title: Updated interface with support for idle connections

This version basically extends the work listed in #21.

It adds more tests, documentation, support for passing in non wrapped connections into Serve(), supports TLS, etc.

It also changes the API to basically exactly match the http package. The Server type not embeds http.Server which means all of that servers public properties and methods are easily accessible and the GracefulServer ends up being just a thin layer around it.

Matching the http package signatures makes for a much easier transition to using the manners package. I also added top level functions which eliminate the need to directly instantiate a GracefulServer directly at all for the common case where you just want to start a server. It then literally becomes a s/http.ListenAndServe/manners.ListenAndServe/ substitution.

It retains all the work done in #21, which basically includes being able to shutdown when idle keep-alive connections are the only connections left connected. eliminates race conditions in tests, etc. This version also passes go lint and uses a dynamic port number in test runs instead of being fixed to 7000.

As the interface isn't backwards compatible it would make sense to be reticent to adopt it, but I thought I'd put it out there before I fork it under a different name for my own use.