Fork me on GitHub

Hi. Is there support for asynchronous stop functions when using mount with ClojureScript. I'm looking to manage the nodejs http server with mount and the close function is async - i.e. it has a callback that is called once connections are closed. Is this something that mount supports in some way?


@mjmeintjes can this callback be #(mount/stop "#'whatever-needs-to-stop")?


@tolitius I'm not sure I understand completely how that would work. For nodejs http server, there is a .close function, which takes as its only argument a callback function that it calls when it has finished closing down (i.e. a "done" function). It does this because it has to wait for any connection to be closed before shutdown can be said to be finished, and in javascript you can't block. I'm just wondering whether mount has support for this concept - i.e. when calling mount/stop, is there a way to indicate that shutdown is "in progress" and that it has to wait for a callback function to be called.