skipcheck

TM1 client · Docs · Sessions and logins

Tm1SessionPoolBuilder

from skipcheck_tm1 import Tm1SessionPoolBuilder

Builds a Tm1SessionPool.

Members

__init__ constructor
idle_timeoutHow long a session may go unused before it's evicted.
max_ageHow long a session may live, used or not.
max_sizeThe most sessions the pool holds (default 100); beyond it, the least recently asked for is evicted, with a request running or not.
close_graceHow 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.
sweep_intervalHow often Tm1SessionPool.sweep_forever looks for expired sessions.
clockThe pool's clock, in seconds (Java's scheduler).
buildThe pool.

__init__

constructor
__init__(sessions: Tm1SessionBuilder)

idle_timeout

idle_timeout(idle_timeout: float | timedelta) -> Tm1SessionPoolBuilder

How long a session may go unused before it's evicted. Default 10 minutes; keep it below TM1's own session timeout.

max_age

max_age(max_age: float | timedelta) -> Tm1SessionPoolBuilder

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

max_size

max_size(max_size: int) -> Tm1SessionPoolBuilder

The most sessions the pool holds (default 100); beyond it, the least recently asked for is evicted, with a request running or not: it leaves the pool, and is closed when its work is done. Evicted sessions in their grace period don't count.

close_grace

close_grace(close_grace: float | timedelta) -> Tm1SessionPoolBuilder

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; 0 closes at the next sweep.

sweep_interval

sweep_interval(sweep_interval: float | timedelta) -> Tm1SessionPoolBuilder

How often Tm1SessionPool.sweep_forever looks for expired sessions. Default 1 minute.

clock

clock(clock: Callable[[], float]) -> Tm1SessionPoolBuilder

The pool's clock, in seconds (Java's scheduler): tests pass one they move.

build

build() -> Tm1SessionPool

The pool. It opens sessions only when asked.