Graceful shutting down of MochiWeb?

37 views
Skip to first unread message

Vishal C

unread,
Jul 5, 2016, 10:54:31 AM7/5/16
to MochiWeb
Hi,

I would like to shutdown MochiWeb as my application is shutting down. However, I do want MochiWeb to,
1. Try and finish all the pending request within the next few seconds (configurable) and then kill those processes if they still haven't completed.
2. Not accept any more new request.
Is there as straight foward way of doing this in Mochi?

thank a lot in advance and glad to be part of the group.

regards,
V

Bob Ippolito

unread,
Jul 5, 2016, 12:54:19 PM7/5/16
to moch...@googlegroups.com
This is not functionality that mochiweb has built-in, but I don't think that it would be terribly hard to build. I'd be happy to accept any such pull requests, especially if it has tests!

If you decide to implement this, most of the functionality would involve mochiweb_socket_server. You would probably want to close the listen port, and then wait for active_sockets to go to 0 or a timeout is reached before terminating.

--
You received this message because you are subscribed to the Google Groups "MochiWeb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mochiweb+u...@googlegroups.com.
To post to this group, send email to moch...@googlegroups.com.
Visit this group at https://groups.google.com/group/mochiweb.
For more options, visit https://groups.google.com/d/optout.

Vishal C

unread,
Jul 11, 2016, 4:12:31 PM7/11/16
to MochiWeb
I have created a new pull request for this..
https://github.com/mochi/mochiweb/pull/178
When you get a chance can you please review it?
thanks,
Vishal
Reply all
Reply to author
Forward
0 new messages