haiway 0.10.13__py3-none-any.whl → 0.10.15__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.
Files changed (43) hide show
  1. {haiway-0.10.13.dist-info → haiway-0.10.15.dist-info}/METADATA +1 -1
  2. haiway-0.10.15.dist-info/RECORD +4 -0
  3. haiway/__init__.py +0 -111
  4. haiway/context/__init__.py +0 -27
  5. haiway/context/access.py +0 -615
  6. haiway/context/disposables.py +0 -78
  7. haiway/context/identifier.py +0 -92
  8. haiway/context/logging.py +0 -176
  9. haiway/context/metrics.py +0 -165
  10. haiway/context/state.py +0 -113
  11. haiway/context/tasks.py +0 -64
  12. haiway/context/types.py +0 -12
  13. haiway/helpers/__init__.py +0 -21
  14. haiway/helpers/asynchrony.py +0 -225
  15. haiway/helpers/caching.py +0 -326
  16. haiway/helpers/metrics.py +0 -459
  17. haiway/helpers/retries.py +0 -223
  18. haiway/helpers/throttling.py +0 -133
  19. haiway/helpers/timeouted.py +0 -112
  20. haiway/helpers/tracing.py +0 -137
  21. haiway/py.typed +0 -0
  22. haiway/state/__init__.py +0 -12
  23. haiway/state/attributes.py +0 -747
  24. haiway/state/path.py +0 -524
  25. haiway/state/requirement.py +0 -229
  26. haiway/state/structure.py +0 -414
  27. haiway/state/validation.py +0 -468
  28. haiway/types/__init__.py +0 -14
  29. haiway/types/default.py +0 -108
  30. haiway/types/frozen.py +0 -5
  31. haiway/types/missing.py +0 -95
  32. haiway/utils/__init__.py +0 -28
  33. haiway/utils/always.py +0 -61
  34. haiway/utils/collections.py +0 -185
  35. haiway/utils/env.py +0 -230
  36. haiway/utils/freezing.py +0 -28
  37. haiway/utils/logs.py +0 -57
  38. haiway/utils/mimic.py +0 -77
  39. haiway/utils/noop.py +0 -24
  40. haiway/utils/queue.py +0 -82
  41. haiway-0.10.13.dist-info/RECORD +0 -42
  42. {haiway-0.10.13.dist-info → haiway-0.10.15.dist-info}/WHEEL +0 -0
  43. {haiway-0.10.13.dist-info → haiway-0.10.15.dist-info}/licenses/LICENSE +0 -0
haiway/utils/queue.py DELETED
@@ -1,82 +0,0 @@
1
- from asyncio import AbstractEventLoop, CancelledError, Future, get_running_loop
2
- from collections import deque
3
- from collections.abc import AsyncIterator
4
-
5
- __all__ = [
6
- "AsyncQueue",
7
- ]
8
-
9
-
10
- class AsyncQueue[Element](AsyncIterator[Element]):
11
- """
12
- Asynchronous queue supporting iteration and finishing.
13
- Cannot be concurrently consumed by multiple readers.
14
- """
15
-
16
- def __init__(
17
- self,
18
- *elements: Element,
19
- loop: AbstractEventLoop | None = None,
20
- ) -> None:
21
- self._loop: AbstractEventLoop = loop or get_running_loop()
22
- self._queue: deque[Element] = deque(elements)
23
- self._waiting: Future[Element] | None = None
24
- self._finish_reason: BaseException | None = None
25
-
26
- def __del__(self) -> None:
27
- self.finish()
28
-
29
- @property
30
- def is_finished(self) -> bool:
31
- return self._finish_reason is not None
32
-
33
- def enqueue(
34
- self,
35
- element: Element,
36
- /,
37
- *elements: Element,
38
- ) -> None:
39
- if self.is_finished:
40
- raise RuntimeError("AsyncQueue is already finished")
41
-
42
- if self._waiting is not None and not self._waiting.done():
43
- self._waiting.set_result(element)
44
-
45
- else:
46
- self._queue.append(element)
47
-
48
- self._queue.extend(elements)
49
-
50
- def finish(
51
- self,
52
- exception: BaseException | None = None,
53
- ) -> None:
54
- if self.is_finished:
55
- return # already finished, ignore
56
-
57
- self._finish_reason = exception or StopAsyncIteration()
58
-
59
- if self._waiting is not None and not self._waiting.done():
60
- self._waiting.set_exception(self._finish_reason)
61
-
62
- def cancel(self) -> None:
63
- self.finish(exception=CancelledError())
64
-
65
- async def __anext__(self) -> Element:
66
- assert self._waiting is None, "Only a single queue consumer is supported!" # nosec: B101
67
-
68
- if self._queue: # check the queue, let it finish
69
- return self._queue.popleft()
70
-
71
- if self._finish_reason is not None: # check if is finished
72
- raise self._finish_reason
73
-
74
- try:
75
- # create a new future to wait for next
76
- self._waiting = self._loop.create_future()
77
- # wait for the result
78
- return await self._waiting
79
-
80
- finally:
81
- # cleanup
82
- self._waiting = None
@@ -1,42 +0,0 @@
1
- haiway/__init__.py,sha256=IEUCyFYKT5IPHnkiUvDVZHdJeHqCaBnG8FhPD20Zgo8,1929
2
- haiway/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- haiway/context/__init__.py,sha256=eRvuhifx7xCd-_6desgk55idzNpD5S5sprmCfGb3_9M,662
4
- haiway/context/access.py,sha256=Fc2NfoIV2zWE5qPnNgSitK1dy-PME-rJJfUPhoNwJzY,17125
5
- haiway/context/disposables.py,sha256=DZjnMp-wMfF-em2Wjhbm1MvXubNpuzFBT70BQNIxC7M,2019
6
- haiway/context/identifier.py,sha256=Fyb6OHx5FPaSLLRK249HUEr_KlBSG5F-eW01Oxg_Ke8,2570
7
- haiway/context/logging.py,sha256=ptwgENuyw-WFgokVsYx9OXZGhJENuO_wgfVjcBryUKM,4251
8
- haiway/context/metrics.py,sha256=Ve628X39u0rdLm0vYmVZt7aGeoEeRquR6f67vJIXClY,4213
9
- haiway/context/state.py,sha256=LCcFxXqDBu6prvPyPicN-ecONSNHyR56PfQ5u5jNFCU,3000
10
- haiway/context/tasks.py,sha256=h6OxLxHHqkw0LfQi81NtbsCKfACKxYRZAkDhlJTpqCM,1904
11
- haiway/context/types.py,sha256=VvJA7wAPZ3ISpgyThVguioYUXqhHf0XkPfRd0M1ERiQ,142
12
- haiway/helpers/__init__.py,sha256=8XRJWNhidWuBKqRZ1Hyc2xqt7DeWLcoOs2V-oexl8VY,579
13
- haiway/helpers/asynchrony.py,sha256=9lo9wT3G0TyPb4vfmTnWGBvB_eN6p6nIlj46_9Ag8fQ,6022
14
- haiway/helpers/caching.py,sha256=Ok_WE5Whe7XqnIuLZo4rNNBFeWap-aUWX799s4b1JAQ,9536
15
- haiway/helpers/metrics.py,sha256=0oFBiO-hAzihyC5jvXevNrYOoTcUGc2yGhE1A_866Mc,13314
16
- haiway/helpers/retries.py,sha256=gIkyUlqJLDYaxIZd3qzeqGFY9y5Gp8dgZLlZ6hs8hoc,7538
17
- haiway/helpers/throttling.py,sha256=zo0OwFq64si5KUwhd58cFHLmGAmYwRbFRJMbv9suhPs,3844
18
- haiway/helpers/timeouted.py,sha256=1xU09hQnFdj6p48BwZl5xUvtIr3zC0ZUXehkdrduCjs,3074
19
- haiway/helpers/tracing.py,sha256=VDOAhdVELaYs92HxHreEo_ZV8b7e6ZQs10lTNn8xOtQ,3383
20
- haiway/state/__init__.py,sha256=emTuwGFn7HyjyTJ_ass69J5jQIA7_WHO4teZz_dR05Y,355
21
- haiway/state/attributes.py,sha256=plCcYGE5LVU1Nvo0GHkhThqFG96uLR3tFsisQyK1jK0,23122
22
- haiway/state/path.py,sha256=4vh-fYQv8_xRWjS0ErMQslKDWRI6-KVECAr8JhYk0UY,17503
23
- haiway/state/requirement.py,sha256=3iQqzp5Q7w6y5uClamJGH7S5Hib9pciuTAV27PP5lS8,6161
24
- haiway/state/structure.py,sha256=bSIj0S_HG-F1Z5GxSlY6VpGtrtiwG82-AIL_PL1lRLo,12465
25
- haiway/state/validation.py,sha256=r0EMIs-nvoXsmSA74oGu6Lrbw8lkzmseaY82_-E8ous,13814
26
- haiway/types/__init__.py,sha256=-j4uDN6ix3GBXLBqXC-k_QOJSDlO6zvNCxDej8vVzek,342
27
- haiway/types/default.py,sha256=IVQsNzDnfukL3-XlScYv2PgTcJ1x_BNP9i5UlS5oEbg,2179
28
- haiway/types/frozen.py,sha256=CZhFCXnWAKEhuWSfILxA8smfdpMd5Ku694ycfLh98R8,76
29
- haiway/types/missing.py,sha256=rDnyA2wxPkTbJl0L-zbo0owp7IJ04xkCIp6xD6wh8NI,1712
30
- haiway/utils/__init__.py,sha256=O7qmAmUktX-X_5D1L5FJMeCFEiOVrrnyYSyiycm4nyg,739
31
- haiway/utils/always.py,sha256=2abp8Lm9rQkrfS3rm1Iqhb-IcWyVfH1BULab3KMxgOw,1234
32
- haiway/utils/collections.py,sha256=pKHZhXqTMcOth7gV6mXcC5WcSyBl70MmVIELbDSmMoA,3320
33
- haiway/utils/env.py,sha256=vlW21LEp8uOVNnUXpBfPtj3zKi9Kkjoemb_H5hQpYPQ,4433
34
- haiway/utils/freezing.py,sha256=K34ZIMzbkpgkHKH-KF73plEbXExsajNRkRTYp9nJEf4,620
35
- haiway/utils/logs.py,sha256=oDsc1ZdqKDjlTlctLbDcp9iX98Acr-1tdw-Pyg3DElo,1577
36
- haiway/utils/mimic.py,sha256=BkVjTVP2TxxC8GChPGyDV6UXVwJmiRiSWeOYZNZFHxs,1828
37
- haiway/utils/noop.py,sha256=qgbZlOKWY6_23Zs43OLukK2HagIQKRyR04zrFVm5rWI,344
38
- haiway/utils/queue.py,sha256=oQ3GXCJ-PGNtMEr6EPdgqAvYZoj8lAa7Z2drBKBEoBM,2345
39
- haiway-0.10.13.dist-info/METADATA,sha256=QyxvFJSNQ9BQON9joaMqHB8DRsoexEfcAwQXmESkljU,3858
40
- haiway-0.10.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
41
- haiway-0.10.13.dist-info/licenses/LICENSE,sha256=GehQEW_I1pkmxkkj3NEa7rCTQKYBn7vTPabpDYJlRuo,1063
42
- haiway-0.10.13.dist-info/RECORD,,