Creates an auto-dispose mechanism for a client session in a swarm.
This function establishes a timer-based auto-dispose system that monitors client activity in a swarm session. If no activity
is detected (via the tick method) within the specified timeout period, the session is automatically disposed using disposeConnection.
The mechanism uses a Source from functools-kit to manage the timer, which can be reset or stopped manually. The execution is wrapped
in beginContext for a clean environment, and an optional callback (onDestroy) can be provided to handle post-disposal actions.
Throws
If disposal via disposeConnection fails when triggered automatically.
Creates an auto-dispose mechanism for a client session in a swarm.
This function establishes a timer-based auto-dispose system that monitors client activity in a swarm session. If no activity is detected (via the
tickmethod) within the specified timeout period, the session is automatically disposed usingdisposeConnection. The mechanism uses aSourcefromfunctools-kitto manage the timer, which can be reset or stopped manually. The execution is wrapped inbeginContextfor a clean environment, and an optional callback (onDestroy) can be provided to handle post-disposal actions.Throws
If disposal via
disposeConnectionfails when triggered automatically.Example