A simple, flexible way to parallelize processing in Python.
Project description
Consumers is a simple, flexible way to parallelize processing in Python.
Documentation
Example
from consumers import Consumer, Queue
class Concatenator(Consumer):
def initialize(self):
self.string = ''
def process(self, letter:
self.string += letter
def shutdown(self):
return self.string
with Queue(Concatenator, quantity=2) as queue:
for i in 'abcdef':
queue.put(i)
print(queue.results)
Output
['bce', 'adf']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
consumers-0.3.0.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for consumers-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4e455de379e945ca2860ee4d7e49b5351ddb509929e4a56d5bf843d89f5075 |
|
MD5 | 4fdeb48f439a7bb6a56bfb85231f60e6 |
|
BLAKE2b-256 | e13f3cb4c9e0d8c14a917008008dba64f4b86b4d1676bbe50cc66dd8c6ee509d |