can any nREPL expert tell me if it is possible for a nREPL middleware to be notified when a nREPL connection is terminated/disconnected?
ie. a middleware received a message and started something running in a separate thread. how do I terminate that thread if the underlying nrepl connection closed and no further messages will come?
maybe even better at the session level? or is there no explicit "this session has ended"?
Just had a look through the source, and looks like when a client disconnects, it dies here: https://github.com/nrepl/nrepl/blob/5aca552d2081ef2f7f0410ce18f2436efd7f30e0/src/clojure/nrepl/server.clj#L56
i'm not aware of any "connection" closed messages
though it's not clear a connection ending is the end of a session.