I'm contemplating a change in nREPL to make it automatically close all persistent sessions that were spawned from a particular connection once that connection is closed. Would anybody have a problem with that? I'm talking about this situation:
• You connect to an nREPL server.
• You evaluate (long-running-task).
• While executing, the connection is broken, so the (long-running-task) is interrupted, and the session is killed.
This will make nREPL behave similarly to e.g. an SSH connection. Once you disconnect (voluntarily or because of a network issue), all spawned processes die too. If you need to submit a long-running task that you want to survive disconnects, track progress, etc – use a dedicated tool for that (terminal multiplexer for SSH, some sort of scheduler for nREPL).
what if there are other clients connected to the same session?
Does any existing client supports this, and why would somebody need this?
Sessions are a concept more internal to nrepl, the user is very rarely exposed to their existence.
A single connection (transport) can multiplex multiple sessions (e.g. CIDER connection spawns a regular eval session and a debugger session), but sharing a session between connections is new to me
I don’t have a strong use-case. I added the ability to list and switch sessions to my clients because I noticed it was possible and I wanted to make sure an agent the exact same view I had from my editor. in practice, I don‘t think it’s ever mattered that much, and if it did the user-base is probably ~1. just curious because it is possible.