How do I implement a shutdown command in a WAI server?
问题 I'd like to implement a 'graceful shutdown' command for my webapp (as opposed to my first instinct, which is to just ask people to kill the process) My first two attempts consisted of liftIO exitSuccess E.yield (responseLBS statusOK [G.contentType "text/plain"] "") E.EOF Both of which just cheerfully returned a result to the client and continued listening. Is there anything an application can do to kill the server? Is this even a reasonable thing to want to do? I confess I don't have a very