haiway 0.24.2__py3-none-any.whl → 0.24.3__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.
@@ -130,9 +130,9 @@ async def process_concurrently[Element]( # noqa: C901, PLR0912
130
130
 
131
131
  @overload
132
132
  async def execute_concurrently[Element, Result](
133
- source: Collection[Element],
134
- /,
135
133
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
134
+ /,
135
+ elements: Collection[Element],
136
136
  *,
137
137
  concurrent_tasks: int = 2,
138
138
  ) -> Sequence[Result]: ...
@@ -140,9 +140,9 @@ async def execute_concurrently[Element, Result](
140
140
 
141
141
  @overload
142
142
  async def execute_concurrently[Element, Result](
143
- source: Collection[Element],
144
- /,
145
143
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
144
+ /,
145
+ elements: Collection[Element],
146
146
  *,
147
147
  concurrent_tasks: int = 2,
148
148
  return_exceptions: Literal[True],
@@ -150,9 +150,9 @@ async def execute_concurrently[Element, Result](
150
150
 
151
151
 
152
152
  async def execute_concurrently[Element, Result]( # noqa: C901
153
- source: Collection[Element],
154
- /,
155
153
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
154
+ /,
155
+ elements: Collection[Element],
156
156
  *,
157
157
  concurrent_tasks: int = 2,
158
158
  return_exceptions: bool = False,
@@ -173,11 +173,11 @@ async def execute_concurrently[Element, Result]( # noqa: C901
173
173
 
174
174
  Parameters
175
175
  ----------
176
- source : Collection[Element]
177
- A collection of elements to process. The collection size determines
178
- the result sequence length.
179
176
  handler : Callable[[Element], Coroutine[Any, Any, Result]]
180
177
  A coroutine function that processes each element and returns a result.
178
+ elements : Collection[Element]
179
+ A collection of elements to process. The collection size determines
180
+ the result sequence length.
181
181
  concurrent_tasks : int, default=2
182
182
  Maximum number of concurrent tasks. Must be greater than 0. Higher
183
183
  values allow more parallelism but consume more resources.
@@ -206,16 +206,16 @@ async def execute_concurrently[Element, Result]( # noqa: C901
206
206
  ...
207
207
  >>> urls = ["http://api.example.com/1", "http://api.example.com/2"]
208
208
  >>> results = await execute_concurrently(
209
- ... urls,
210
209
  ... fetch_data,
210
+ ... urls,
211
211
  ... concurrent_tasks=10
212
212
  ... )
213
213
  >>> # results[0] corresponds to urls[0], results[1] to urls[1], etc.
214
214
 
215
215
  >>> # With exception handling
216
216
  >>> results = await execute_concurrently(
217
- ... urls,
218
217
  ... fetch_data,
218
+ ... urls,
219
219
  ... concurrent_tasks=10,
220
220
  ... return_exceptions=True
221
221
  ... )
@@ -230,7 +230,7 @@ async def execute_concurrently[Element, Result]( # noqa: C901
230
230
  running: set[Task[Result]] = set()
231
231
  results: MutableSequence[Task[Result]] = []
232
232
  try:
233
- for element in source:
233
+ for element in elements:
234
234
  task: Task[Result] = ctx.spawn(handler, element)
235
235
  results.append(task)
236
236
  running.add(task)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiway
3
- Version: 0.24.2
3
+ Version: 0.24.3
4
4
  Summary: Framework for dependency injection and state management within structured concurrency model.
5
5
  Project-URL: Homepage, https://miquido.com
6
6
  Project-URL: Repository, https://github.com/miquido/haiway.git
@@ -11,7 +11,7 @@ haiway/context/types.py,sha256=LoW8238TTdbUgmxyHDi0LVc8M8ZwTHLWKkAPttTsTeg,746
11
11
  haiway/helpers/__init__.py,sha256=J1WQdI2jD_zDP4azn9Me6hVvaBtz8kh9kTN-jDgDA5U,836
12
12
  haiway/helpers/asynchrony.py,sha256=Ddj8UdXhVczAbAC-rLpyhWa4RJ_W2Eolo45Veorq7_4,5362
13
13
  haiway/helpers/caching.py,sha256=BqgcUGQSAmXsuLi5V8EwlZzuGyutHOn1V4k7BHsGKeg,14347
14
- haiway/helpers/concurrent.py,sha256=P8YXukabb29iQhSKTECVaThPhzTX17JDdKrWAjHy4d4,13105
14
+ haiway/helpers/concurrent.py,sha256=fU6je62XvbySylZKDgzC_AGKPC7Kimmd5SmkVpySBUo,13115
15
15
  haiway/helpers/files.py,sha256=L6vXd8gdgWx5jPL8azloU8IGoFq2xnxjMc4ufz-gdl4,11650
16
16
  haiway/helpers/observability.py,sha256=jCJzOPJ5E3RKJsbbGRR1O-mZydaHNIGkIpppOH7nFBA,11012
17
17
  haiway/helpers/retries.py,sha256=OH__I9e-PUFxcSwuQLIzJ9F1MwXgbz1Ur4jEjJiOmjQ,8974
@@ -39,7 +39,7 @@ haiway/utils/mimic.py,sha256=xaZiUKp096QFfdSw7cNIKEWt2UIS7vf880KF54gny38,1831
39
39
  haiway/utils/noop.py,sha256=U8ocfoCgt-pY0owJDPtrRrj53cabeIXH9qCKWMQnoRk,1336
40
40
  haiway/utils/queue.py,sha256=6v2u3pA6A44IuCCTOjmCt3yLyOcm7PCRnrIGo25j-1o,6402
41
41
  haiway/utils/stream.py,sha256=lXaeveTY0-AYG5xVzcQYaiC6SUD5fUtHoMXiQcrQAAM,5723
42
- haiway-0.24.2.dist-info/METADATA,sha256=nNfy1ktM-nzZnRYVfAz7QvTBQRZQqE_-NuUm5dz4NWs,4919
43
- haiway-0.24.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
- haiway-0.24.2.dist-info/licenses/LICENSE,sha256=3phcpHVNBP8jsi77gOO0E7rgKeDeu99Pi7DSnK9YHoQ,1069
45
- haiway-0.24.2.dist-info/RECORD,,
42
+ haiway-0.24.3.dist-info/METADATA,sha256=jQMih-4aqEmQRFaHKmcbuldMG8yf74t5SYYMKXIVHcc,4919
43
+ haiway-0.24.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
44
+ haiway-0.24.3.dist-info/licenses/LICENSE,sha256=3phcpHVNBP8jsi77gOO0E7rgKeDeu99Pi7DSnK9YHoQ,1069
45
+ haiway-0.24.3.dist-info/RECORD,,