Tm1SessionPoolBuilder
import { Tm1SessionPoolBuilder } from "@skipcheck/tm1-client"; Builds a Tm1SessionPool.
Members
Tm1SessionPoolBuilder constructor | @internal Made by Tm1SessionPool.builder. |
idleTimeout | How long a session may go unused before it's evicted. |
maxAge | How long a session may live, used or not, before it's evicted. |
maxSize | The most sessions the pool holds; beyond it, the least recently used is evicted. |
closeGrace | 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. |
sweepInterval | How often the pool looks for expired sessions on its own, besides on each Tm1SessionPool.session call. |
clock | Where the pool's timers run, and its clock (Java's scheduler). |
build | The pool. |
Tm1SessionPoolBuilder
constructorconstructor(private readonly sessions: Tm1SessionBuilder)@internal Made by Tm1SessionPool.builder.
idleTimeout
idleTimeout(ms: number): thisHow 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): thisHow 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): thisThe 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): thisHow 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): thisHow often the pool looks for expired sessions on its own, besides on each Tm1SessionPool.session call. Default 1 minute.
clock
clock(clock: Tm1Clock): thisWhere the pool's timers run, and its clock (Java's scheduler): Tm1Clock.system unless set; tests pass one they move by hand.
build
build(): Tm1SessionPoolThe pool. It starts its sweep at once, and opens sessions only when asked.