nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
thheller 2019-09-16T08:36:30.000400Z

can any nREPL expert tell me if it is possible for a nREPL middleware to be notified when a nREPL connection is terminated/disconnected?

thheller 2019-09-16T08:36:41.000600Z

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?

thheller 2019-09-16T08:37:29.001400Z

maybe even better at the session level? or is there no explicit "this session has ended"?

shen 2019-09-25T08:13:00.002Z

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

shen 2019-09-25T08:16:12.002300Z

i'm not aware of any "connection" closed messages

shen 2019-09-25T08:17:31.002500Z

though it's not clear a connection ending is the end of a session.