PooledClient (per-loop pooling, satisfies the contract
BaseClient Protocol) and is reached by class through client_ctx. The
driver each impl needs is declared by an extra (tai42-kit[curl] /
[postgres]); import a driver submodule only when its driver is installed.
ClientDisconnectedError
tai42_contract.errors.ClientDisconnectedError
ClientSettings
tai42_kit.clients.settings.ClientSettings
client_kwargs().
Attributes
Members
client_kwargs
tai42_kit.clients.settings.ClientSettings.client_kwargs
_create / current.
PooledClient
tai42_kit.clients.base.PooledClient
T.
Subclasses implement _create and _close; callers lease the shared client
through current, which rebuilds it after a classified disconnection.
Members
pool_key
tai42_kit.clients.base.PooledClient.pool_key
kwargs: two calls with equal keys share one pooled client.
Parameters
current
tai42_kit.clients.base.PooledClient.current
kwargs, creating it on first use.
A disconnection inside the body evicts and closes the client and raises
ClientDisconnectedError; retry to rebuild it. On a loop its end has
marked closing (tai42_kit.loop_closing) a new lease raises
RuntimeError; a lease held from before keeps its client.
Parameters
close
tai42_kit.clients.base.PooledClient.close
kwargs in the current epoch, if one is pooled.
Parameters
PostgresConnectionOptions
tai42_kit.clients.settings.PostgresConnectionOptions
PostgresConnectionSettings, and of a door’s own namespace when
the door brings its own DSN and takes only its behaviour from settings.
Attributes
PostgresConnectionSettings
tai42_kit.clients.settings.PostgresConnectionSettings
TAI_DATABASE_<NAME>_ prefix.
Attributes
Members
pg_dsn
tai42_kit.clients.settings.PostgresConnectionSettings.pg_dsn
client_kwargs
tai42_kit.clients.settings.PostgresConnectionSettings.client_kwargs
min_size/max_size and retry_attempts are
this database’s deployment build options, read when the pool is built; a second
settings prefix resolving to the same DSN with different values raises rather than
forking a second pool. env_prefix rides along (not identity) so the client can
derive the owning component for the pool name.
RedisConnectionOptions
tai42_kit.clients.settings.RedisConnectionOptions
RedisConnectionSettings, and of a door’s own namespace when the
door brings its own connection string and takes only its behaviour from settings.
Attributes
Members
connection_options
tai42_kit.clients.settings.RedisConnectionOptions.connection_options
redis_connection_options takes.
RedisConnectionSettings
tai42_kit.clients.settings.RedisConnectionSettings
<PREFIX>DECODE_RESPONSES, default on).
Attributes
Members
client_kwargs
tai42_kit.clients.settings.RedisConnectionSettings.client_kwargs
decode_responses.
RedisConnectionSettingsBase
tai42_kit.clients.settings.RedisConnectionSettingsBase
RedisConnectionSettings, and of a component’s own connection
when its code fixes the decode mode at each connection: client_kwargs then
carries no decode_responses, and every caller adds the one its code reads.
Attributes
Members
client_kwargs
tai42_kit.clients.settings.RedisConnectionSettingsBase.client_kwargs
max_connections, the socket timeouts and the retry options together
select one pooled client per loop. For redis-py the connection options are the
client’s contract, so two components resolving to the same URL with different
options get two clients by design — never a conflict. Every value must be
JSON-serializable: retry_attempts travels as an int and the kit’s materialiser
(redis_from_url_kwargs) turns it into a Retry object at construction time.
env_prefix names this store’s component (so the client can name its own env
var when redis_url is unset) and is a passenger, not identity — it never
splits a pool. No decode mode is carried here; the caller adds it.
advance_client_epoch
tai42_kit.clients.base.advance_client_epoch
current() leases pool under the new epoch; the retired epoch’s pools
stay live until their last lease releases (or drain_epoch force-closes
them at a deadline). The same counter stamps cached settings instances.
client_ctx
tai42_kit.clients.facade.client_ctx
client_cls.
Pass either settings (its client_kwargs() supplies the connection kwargs) or raw
**kwargs, never both. fresh=True builds a one-shot client outside the pool and closes it
on exit; otherwise the client is pooled and reused per event-loop + connection params.
Parameters
current_client_epoch
tai42_kit.clients.base.current_client_epoch
drain_epoch
tai42_kit.clients.base.drain_epoch
deadline seconds for every leased client of epoch to reach
zero leases (each closes itself on its last release), then force-closes any
that remain regardless of held leases, collecting failures into an
ExceptionGroup so none is dropped. Must run on the loop that owns the
pools; the current epoch cannot be drained.
Parameters

