Class Tm1SessionPool.Builder
java.lang.Object
io.skipcheck.tm1.client.session.Tm1SessionPool.Builder
- Enclosing class:
Tm1SessionPool
Builds a
Tm1SessionPool.-
Method Summary
Modifier and TypeMethodDescriptionbuild()The pool.closeGrace(Duration 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.idleTimeout(Duration idleTimeout) How long a session may go unused before it's evicted.How long a session may live, used or not, before it's evicted.maxSize(int maxSize) The most sessions the pool holds; beyond it, the least recently used is evicted.scheduler(reactor.core.scheduler.Scheduler scheduler) Where the pool's timers run, and its clock.sweepInterval(Duration sweepInterval) How often the pool looks for expired sessions on its own, besides on eachTm1SessionPool.session(Tm1Identity)call.
-
Method Details
-
idleTimeout
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.- Parameters:
idleTimeout- the idle limit- Returns:
- this builder
-
maxAge
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.- Parameters:
maxAge- the age limit- Returns:
- this builder
-
maxSize
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.- Parameters:
maxSize- the limit, at least 1- Returns:
- this builder
-
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. A session with a request running stays open until that finishes, however long the grace period. Default 30 s; zero closes at once.- Parameters:
closeGrace- the grace period- Returns:
- this builder
-
sweepInterval
How often the pool looks for expired sessions on its own, besides on eachTm1SessionPool.session(Tm1Identity)call. Default 1 minute.- Parameters:
sweepInterval- the interval- Returns:
- this builder
-
scheduler
Where the pool's timers run, and its clock. DefaultSchedulers.parallel(); tests can pass aVirtualTimeScheduler.- Parameters:
scheduler- the scheduler- Returns:
- this builder
-
build
The pool. It starts its sweep at once, and opens sessions only when asked.- Returns:
- the pool
-