Skip to content

pool 0.1.1

Choose a tag to compare

@sonic182 sonic182 released this 13 Nov 21:57
· 46 commits to main since this release
5aac32c

Needs Agentica 0.31.0.

Changed

  • With lease_ms above 0, checkout runs in the task of the body, not in a task of its own, so a check costs no task. The caller still waits at most 5 seconds for it, and a checkout that refuses, crashes or hangs still ends the resource without reaching the caller, which gets the next resource at its place in line.
  • A body that runs in a task of the pool does not start when the drain of a close ended while its checkout ran, also when the owner is still running (another resource in a slow init): the caller gets pool error: closed. The 5 seconds that a caller waits for checkout hold for one that waits (a sleep, a channel, I/O, a compute def), not for one that blocks in a plain native def call.
  • close returns after the last count is written: waiting and live are 0 when it returns.

Documented

  • checkin runs at most once for each body that ran (the 0.1.0 entry said once): a caller cancelled with lease_ms 0 after it told the pool it is checking in, and before its checkin starts, has its resource ended with no checkin.
  • A terminate that never returns holds its place and the pool does not replace the resource, so each one makes the pool one resource smaller; terminate runs in the keeper, which owns the handles, so it cannot be bounded with a task.