Thread related convenience classes and functions.
Class AdjustableSemaphore
A semaphore whose value may be tuned after instantiation.
Function bg(func, daemon=None, name=None, no_start=False, no_logexc=False)
Dispatch the callable func in its own Thread; return the Thread.
Parameters:
func: callable to run in its ownThread.daemon: optional argument specifying the .daemon attribute.name: optional argument specifying the Thread name.no_start: optional argument, defaultFalse. If true, do not start theThread.no_logexc: if false (defaultFalse), wrapfuncin@logexc.
Class LockableMixin
Trite mixin to control access to an object via its ._lock attribute. Exposes the ._lock as the property .lock. Presents a context manager interface for obtaining an object's lock.
Function locked(func)
A decorator for monitor functions that must run within a lock. Relies upon a ._lock attribute for locking.
Function locked_property(func, lock_name='_lock', prop_name=None, unset_object=None)
A thread safe property whose value is cached. The lock is taken if the value needs to computed.
Function via(cmanager, func, *a, **kw)
Return a callable that calls the supplied func inside a
with statement using the context manager cmanager.
This intended use case is aimed at deferred function calls.
Class WorkerThreadPool
MRO: cs.resources.MultiOpenMixin, cs.obj.O
A pool of worker threads to run functions.
Method WorkerThreadPool.__init__(self, name=None, max_spare=4)
Initialise the WorkerThreadPool.
Paramaters:
name: optional name for the pool
max_spare: maximum size of each idle pool (daemon and non-daemon)
Class WTPoolEntry
MRO: builtins.tuple
WTPoolEntry(thread, queue)
Metadata
Release files for cs-threads 20190729
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cs.threads-20190729.tar.gz | 5.6 kB | Details |
Release files / cs.threads-20190729.tar.gz
| Download URL | cs.threads-20190729.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71b9fd278dd016d5e7b5e1a571bfe47a8daa2d91f69c38b464b01898e20a500d
|
|
BLAKE2b-256 checksum How to use checksums |
b53e25ef0bb0266815f81d9b1989c2338324fffc0901b0818ad3a5c036f16b00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4
|