queutils 0.10.0__py3-none-any.whl → 0.10.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- queutils/iterablequeue.py +3 -3
- {queutils-0.10.0.dist-info → queutils-0.10.1.dist-info}/METADATA +6 -7
- {queutils-0.10.0.dist-info → queutils-0.10.1.dist-info}/RECORD +5 -5
- {queutils-0.10.0.dist-info → queutils-0.10.1.dist-info}/WHEEL +0 -0
- {queutils-0.10.0.dist-info → queutils-0.10.1.dist-info}/licenses/LICENSE +0 -0
queutils/iterablequeue.py
CHANGED
@@ -50,7 +50,7 @@ class IterableQueue(Queue[T], AsyncIterable[T], Countable):
|
|
50
50
|
- AsyncIterable(): async for item in queue:
|
51
51
|
- Automatic termination of the consumers when the queue has been emptied with QueueDone exception
|
52
52
|
- Producers must be registered with add_producer() and they must notify the queue
|
53
|
-
with
|
53
|
+
with finish_producer() once they have finished adding items
|
54
54
|
- Countable interface to count number of items task_done() through 'count' property
|
55
55
|
|
56
56
|
IterableQueue stages:
|
@@ -166,7 +166,7 @@ class IterableQueue(Queue[T], AsyncIterable[T], Countable):
|
|
166
166
|
"""
|
167
167
|
Producer has finished adding items to the queue.
|
168
168
|
Once the last producers has finished, the queue is_filled.
|
169
|
-
- all:
|
169
|
+
- all: finish_producer() queue for all producers at once
|
170
170
|
|
171
171
|
Return True if the last producer is 'finished'
|
172
172
|
"""
|
@@ -177,7 +177,7 @@ class IterableQueue(Queue[T], AsyncIterable[T], Countable):
|
|
177
177
|
self._producers -= 1
|
178
178
|
|
179
179
|
if self._producers < 0:
|
180
|
-
raise ValueError("Too many
|
180
|
+
raise ValueError("Too many finish_producer() calls")
|
181
181
|
elif all or self._producers == 0:
|
182
182
|
self._filled.set()
|
183
183
|
self._producers = 0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: queutils
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1
|
4
4
|
Summary: Handy Python Queue utilies
|
5
5
|
Project-URL: Homepage, https://github.com/Jylpah/queutils
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Jylpah/queutils/issues
|
@@ -58,11 +58,10 @@ an `asyncio.Queue` compatible interface to a (non-async) managed `multiprocessin
|
|
58
58
|
`IterableQueue` is an `asyncio.Queue` subclass that is `AsyncIterable[T]` i.e. it can be
|
59
59
|
iterated in `async for` loop. `IterableQueue` terminates automatically when the queue has been filled and emptied.
|
60
60
|
|
61
|
-
The `IterableQueue` requires "producers" (functions adding items to the queue) to register themselves with `add_producer()` call
|
62
|
-
|
63
|
-
producers are "finished", the queue enters into "filled" state and no new items can be added. Once
|
64
|
-
|
65
|
-
`raise QueueDone` exception.
|
61
|
+
The `IterableQueue` requires "producers" (functions adding items to the queue) to register themselves with `add_producer()` call. It keeps count of registered producers. When a producer "finishes" adding items to the queue,
|
62
|
+
it needs to unregister itself with `finish_producer()` call. Once all the registered
|
63
|
+
producers are "finished", the queue enters into "filled" state and no new items can be added. Once a "filled" queue has been emptied, the queue becomes "done" and
|
64
|
+
all new `get()` calls to the queue will `raise QueueDone` exception.
|
66
65
|
|
67
66
|
## Features
|
68
67
|
|
@@ -70,7 +69,7 @@ producers are "finished", the queue enters into "filled" state and no new items
|
|
70
69
|
- `AsyncIterable` support: `async for item in queue:`
|
71
70
|
- Automatic termination of the consumers with `QueueDone` exception when the queue has been emptied
|
72
71
|
- Producers must be registered with `add_producer()` and they must notify the queue
|
73
|
-
with `
|
72
|
+
with `finish_producer()` once they have finished adding items
|
74
73
|
- Countable interface to count number of items task_done() through `count` property
|
75
74
|
|
76
75
|
# EventCounterQueue
|
@@ -4,9 +4,9 @@ queutils/awrap.py,sha256=QydWBLmyNIHpYrRwVFn1RWjbQKRnJr61u-DYl7d3F7w,1293
|
|
4
4
|
queutils/countable.py,sha256=YSi7ILf9CuB5Tm3T4UUMEFlveqzqcmomfqJAlLGHEz8,172
|
5
5
|
queutils/eventcounterqueue.py,sha256=9CvgfnWmvXrMr3h-RiQyIVIBXqOnGvohql_ADvdlmxo,2913
|
6
6
|
queutils/filequeue.py,sha256=J_UK3VHKaM4ELFzedtj6lDmlXas8O732aC0nO8zNzNo,5256
|
7
|
-
queutils/iterablequeue.py,sha256=
|
7
|
+
queutils/iterablequeue.py,sha256=1daJGZaag5whKL04SmLACMvLK9kYLV9-HSLfURDDh_4,8726
|
8
8
|
queutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
queutils-0.10.
|
10
|
-
queutils-0.10.
|
11
|
-
queutils-0.10.
|
12
|
-
queutils-0.10.
|
9
|
+
queutils-0.10.1.dist-info/METADATA,sha256=UvuDD9ZbFJYNwD1AUwiTv0v30Jv2tffYuTVqW_9rhT4,4708
|
10
|
+
queutils-0.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
11
|
+
queutils-0.10.1.dist-info/licenses/LICENSE,sha256=J1zeIKU2JVQmhwO2hHQDK8WR6zjVZ-wX8r7ZlL45AbI,1063
|
12
|
+
queutils-0.10.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|