Class SessionOpener
Implements
- PromiseLike<Session>
Constructors
constructor
-
new SessionOpener(
operations: MemoryOperations,
domain: string,
options: TimeoutOptions,
): SessionOpenerParameters
- operations: MemoryOperations
The namespace to open the session on.
- domain: string
The domain to open it in.
- options: TimeoutOptions
Per-call deadline.
Returns SessionOpener
- operations: MemoryOperations
A session that has not been opened yet.
Awaiting it opens one and yields the Session; awaiting it again yields the same session rather than opening a second one. Nothing is sent until it is awaited, so an opener that is created and dropped costs no call and produces no unhandled rejection.
It deliberately carries no
Symbol.asyncDisposeof its own.await usingbinds the expression rather than anything awaited out of it, soawait using s = client.memory.withSession(d)would bind this object and not the session it opens — leaving that off makes it a type error rather than a puzzle at run time. Writeawait using s = await client.memory.withSession(d).