diff --git a/CHANGELOG.md b/CHANGELOG.md index b794b724729058e6229c32911e59f5d1e5a9723a..288a597676d6cf348dc210deac78fe847e6e20dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,3 @@ # v2.18.6 + +* queue_get will be safe against multiple consumers diff --git a/satella/__init__.py b/satella/__init__.py index c1ce47d24eab212de4ffdd47f9f66d521e8737af..7fbf3a1c46aaa1ceafe3948466273be53f95615b 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.18.6a1' +__version__ = '2.18.6' diff --git a/satella/coding/concurrent/monitor.py b/satella/coding/concurrent/monitor.py index 85fcafad301ac159f1d2b2968c52bbfc2cf8df1c..2a6515399043cc283d00454e9d62e67cdcd3091f 100644 --- a/satella/coding/concurrent/monitor.py +++ b/satella/coding/concurrent/monitor.py @@ -5,9 +5,6 @@ import typing as tp from ..decorators.decorators import wraps -__all__ = [ - 'Monitor', 'RMonitor', 'MonitorDict', 'MonitorList' -] from ..typing import K, V, T diff --git a/satella/coding/misc.py b/satella/coding/misc.py index 7377f33ceedafaae12337d5313cd2b9ef7201431..5bb0092d383a9939f925df4d608355bf6145757a 100644 --- a/satella/coding/misc.py +++ b/satella/coding/misc.py @@ -5,6 +5,7 @@ from inspect import Parameter, signature from queue import Queue from satella.coding.recast_exceptions import rethrow_as +from queue import Empty def enum_value(value): @@ -122,7 +123,10 @@ def queue_iterator(queue: Queue) -> tp.Iterator: >>> yield queue.get() """ while queue.qsize() > 0: - yield queue.get() + try: + yield queue.get(block=False) + except Empty: + return def update_if_not_none(dictionary: tp.Dict, key: tp.Hashable, value) -> tp.Dict: