This document describes the current stable version of Kombu (5.3). For development docs, go here.
Resource Management - kombu.resource
¶
Generic resource pool implementation.
- class kombu.resource.Resource(limit=None, preload=None, close_after_fork=None)[source]¶
Pool of resources.
- exception LimitExceeded¶
Limit exceeded.
- acquire(block=False, timeout=None)[source]¶
Acquire resource.
Arguments:¶
- block (bool): If the limit is exceeded,
then block until there is an available item.
- timeout (float): Timeout to wait
if
block
is true. Default isNone
(forever).
- raises LimitExceeded:
if block is false and the limit has been exceeded.:
- close_after_fork = False¶
- force_close_all()[source]¶
Close and remove all resources in the pool (also those in use).
Used to close resources from parent processes after fork (e.g. sockets/connections).
- property limit¶