rawhat / glisten

A pure gleam TCP library
Apache License 2.0
55 stars 8 forks source link

Add support for graceful shutdown #8

Open rawhat opened 1 year ago

rawhat commented 1 year ago

You should be able to send a message to the top-level supervisor. This should stop accepting new connections and allow existing connections to complete. If everything is complete, it should shut down. If anything goes longer than the specified time, we should forcefully bring the process down.

rawhat commented 4 months ago

Been randomly thinking about this off and on for, damn, I guess almost a year lol.

I think the approach would have to be something like this:

I think maybe we'll need a way to shut down the supervisor? Or otherwise tell it we're trying to shut down... need to test if normal shutdown will make the children restart (I would expect them to?).