diff --git a/src/common/compute/interactive/session.js b/src/common/compute/interactive/session.js index 51faf5b0f..e8d9d2b06 100644 --- a/src/common/compute/interactive/session.js +++ b/src/common/compute/interactive/session.js @@ -142,6 +142,18 @@ define([ } } + async forkAndRun(fn) { + const session = this.fork(); + try { + const result = await fn(session); + session.close(); + return result; + } catch (err) { + session.close(); + throw err; + } + } + close() { this.channel.onClientExit(this.id); }