|
Documentation - Modules
3.8.7. Pool The pool module provides support for server-pooled variables. That is support for variables whose lifetime begins when declared, and ends when explicitly deleted or when the server dies. These variables are often useful for caching information that would be expensive to compute from scratch for each request. Another common use of pool variables is to store file- or memory-based lock objects for concurrency control. A pooled variable can hold any Python value. The pool module may be accessed as a regular dictionary, supporting the usual get, set, delete, has_key, keys, values and clear operations. The example below shows how the module is used:
Pool performance suffers when not used with the Spyce webserver in threaded concurrency mode; Spyce has to un/pickle the shared pool with each request since there is no single long-lived process that can keep the data in-memory.
| |||||||||||||
|