skipcheck

TM1 client · Docs · Sessions and logins

Tm1SessionPoolBuilder

import { Tm1SessionPoolBuilder } from "@skipcheck/tm1-client";

Builds a Tm1SessionPool.

Members

Tm1SessionPoolBuilder constructor@internal Made by Tm1SessionPool.builder.
idleTimeoutHow long a session may go unused before it's evicted.
maxAgeHow long a session may live, used or not, before it's evicted.
maxSizeThe most sessions the pool holds; beyond it, the least recently used is evicted.
closeGraceHow long an evicted session stays open before it's closed, for a caller that got it just before and hasn't sent its request yet.
sweepIntervalHow often the pool looks for expired sessions on its own, besides on each Tm1SessionPool.session call.
clockWhere the pool's timers run, and its clock (Java's scheduler).
buildThe pool.

Tm1SessionPoolBuilder

constructor
constructor(private readonly sessions: Tm1SessionBuilder)

@internal Made by Tm1SessionPool.builder.

idleTimeout

idleTimeout(ms: number): this

How long a session may go unused before it's evicted. Default 10 minutes. Keep it below TM1's own session timeout, so the pool closes sessions before TM1 drops them.

maxAge

maxAge(ms: number): this

How long a session may live, used or not, before it's evicted. Default 8 hours. A session also picks up security changes, such as new rights, only when it's new.

maxSize

maxSize(maxSize: number): this

The most sessions the pool holds; beyond it, the least recently used is evicted. Default 100. Evicted sessions in their grace period don't count.

closeGrace

closeGrace(ms: number): this

How long an evicted session stays open before it's closed, for a caller that got it just before and hasn't sent its request yet. A session with a request running stays open until that finishes, however long the grace period. Default 30 s; zero closes at once.

sweepInterval

sweepInterval(ms: number): this

How often the pool looks for expired sessions on its own, besides on each Tm1SessionPool.session call. Default 1 minute.

clock

clock(clock: Tm1Clock): this

Where the pool's timers run, and its clock (Java's scheduler): Tm1Clock.system unless set; tests pass one they move by hand.

build

build(): Tm1SessionPool

The pool. It starts its sweep at once, and opens sessions only when asked.