I have a basic mochiweb poll loop that looks like this, except that it does other things instead of printing to the console and ultimately returns:
blah() -> io:format("Blah") blah() loop(Req) -> PathParts = string:tokens(Req:get(path), "/") case PathParts of ["poll"] -> blah()
This works fine until the client aborts their request. For example, if the client window is closed, this process continues to run indefinitely.
I would like to know if there is an option in mochiweb start () or perhaps something else that I forgot that mochiweb will automatically terminate this process or at least send a client abort message. Any ideas?
source share