elli-lib / elli

Simple, robust and performant Erlang web server
https://github.com/elli-lib/elli/blob/develop/doc/README.md
MIT License
324 stars 38 forks source link

Improved acceptor pool #80

Open tsloughter opened 4 years ago

tsloughter commented 4 years ago

I've wanted to bring this up for a while and just realized I have a perfect PR on another project that shows what I'd want to do, so I'm opening this with https://github.com/adoptingerlang/service_discovery/pull/9/files

The reason I've been hesitant to bring it up is Elli currently has no dependencies and I'd expect adding a dependency would be controversial because of that.

The dependency would be https://github.com/fishcakez/acceptor_pool/

What it brings to Elli you can see if you look at the PR and how the pool and listen socket are started separately (in that order) allowing for shutdown to first close the listen socket, preventing new requests, and then (with an optional grace period) shutdown the other connections.

tsloughter commented 4 years ago

I need to write examples to actually test this with Elli but acceptor_pool is also supposed to be built for release upgrades to work properly.

yurrriq commented 4 years ago

Sounds good to me!