Executes a provided function within a managed scope, handling session creation, validation, and cleanup.
Type of the result returned by the run function.
The function to execute, receiving clientId and agentName as arguments.
Configuration options for the scope operation.
The result of the run function or void if no result is returned.
If a session already exists for the clientId.
Executes a provided function within a managed scope, handling session creation, validation, and cleanup.