ez-a-sync 0.32.24__cp310-cp310-musllinux_1_2_i686.whl → 0.32.26__cp310-cp310-musllinux_1_2_i686.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.

Potentially problematic release.


This version of ez-a-sync might be problematic. Click here for more details.

Files changed (67) hide show
  1. a_sync/_smart.c +9024 -8813
  2. a_sync/_smart.cpython-310-i386-linux-gnu.so +0 -0
  3. a_sync/a_sync/_descriptor.c +7775 -7014
  4. a_sync/a_sync/_descriptor.cpython-310-i386-linux-gnu.so +0 -0
  5. a_sync/a_sync/_flags.c +1803 -1528
  6. a_sync/a_sync/_flags.cpython-310-i386-linux-gnu.so +0 -0
  7. a_sync/a_sync/_helpers.c +4705 -4177
  8. a_sync/a_sync/_helpers.cpython-310-i386-linux-gnu.so +0 -0
  9. a_sync/a_sync/_kwargs.c +5005 -3789
  10. a_sync/a_sync/_kwargs.cpython-310-i386-linux-gnu.so +0 -0
  11. a_sync/a_sync/abstract.c +5018 -4139
  12. a_sync/a_sync/abstract.cpython-310-i386-linux-gnu.so +0 -0
  13. a_sync/a_sync/base.c +5927 -4970
  14. a_sync/a_sync/base.cpython-310-i386-linux-gnu.so +0 -0
  15. a_sync/a_sync/flags.c +2301 -1406
  16. a_sync/a_sync/flags.cpython-310-i386-linux-gnu.so +0 -0
  17. a_sync/a_sync/function.c +14439 -14477
  18. a_sync/a_sync/function.cpython-310-i386-linux-gnu.so +0 -0
  19. a_sync/a_sync/method.c +10974 -11581
  20. a_sync/a_sync/method.cpython-310-i386-linux-gnu.so +0 -0
  21. a_sync/a_sync/modifiers/manager.c +6686 -5361
  22. a_sync/a_sync/modifiers/manager.cpython-310-i386-linux-gnu.so +0 -0
  23. a_sync/a_sync/property.c +12790 -13674
  24. a_sync/a_sync/property.cpython-310-i386-linux-gnu.so +0 -0
  25. a_sync/a_sync/property.pyx +2 -3
  26. a_sync/async_property/cached.c +7485 -7765
  27. a_sync/async_property/cached.cpython-310-i386-linux-gnu.so +0 -0
  28. a_sync/async_property/proxy.c +12574 -14249
  29. a_sync/async_property/proxy.cpython-310-i386-linux-gnu.so +0 -0
  30. a_sync/asyncio/as_completed.c +7104 -6780
  31. a_sync/asyncio/as_completed.cpython-310-i386-linux-gnu.so +0 -0
  32. a_sync/asyncio/create_task.c +9217 -8541
  33. a_sync/asyncio/create_task.cpython-310-i386-linux-gnu.so +0 -0
  34. a_sync/asyncio/create_task.pyx +38 -43
  35. a_sync/asyncio/gather.c +6339 -5704
  36. a_sync/asyncio/gather.cpython-310-i386-linux-gnu.so +0 -0
  37. a_sync/asyncio/igather.c +5143 -4562
  38. a_sync/asyncio/igather.cpython-310-i386-linux-gnu.so +0 -0
  39. a_sync/asyncio/sleep.c +3653 -3088
  40. a_sync/asyncio/sleep.cpython-310-i386-linux-gnu.so +0 -0
  41. a_sync/debugging.c +6015 -5878
  42. a_sync/debugging.cpython-310-i386-linux-gnu.so +0 -0
  43. a_sync/exceptions.c +5529 -5498
  44. a_sync/exceptions.cpython-310-i386-linux-gnu.so +0 -0
  45. a_sync/functools.c +5104 -4052
  46. a_sync/functools.cpython-310-i386-linux-gnu.so +0 -0
  47. a_sync/iter.c +15301 -15508
  48. a_sync/iter.cpython-310-i386-linux-gnu.so +0 -0
  49. a_sync/primitives/_debug.c +5710 -4819
  50. a_sync/primitives/_debug.cpython-310-i386-linux-gnu.so +0 -0
  51. a_sync/primitives/_loggable.c +4400 -3445
  52. a_sync/primitives/_loggable.cpython-310-i386-linux-gnu.so +0 -0
  53. a_sync/primitives/locks/counter.c +6455 -6083
  54. a_sync/primitives/locks/counter.cpython-310-i386-linux-gnu.so +0 -0
  55. a_sync/primitives/locks/event.c +6449 -5579
  56. a_sync/primitives/locks/event.cpython-310-i386-linux-gnu.so +0 -0
  57. a_sync/primitives/locks/prio_semaphore.c +9080 -8534
  58. a_sync/primitives/locks/prio_semaphore.cpython-310-i386-linux-gnu.so +0 -0
  59. a_sync/primitives/locks/semaphore.c +8629 -7948
  60. a_sync/primitives/locks/semaphore.cpython-310-i386-linux-gnu.so +0 -0
  61. a_sync/utils/repr.c +5914 -4759
  62. a_sync/utils/repr.cpython-310-i386-linux-gnu.so +0 -0
  63. {ez_a_sync-0.32.24.dist-info → ez_a_sync-0.32.26.dist-info}/METADATA +2 -2
  64. {ez_a_sync-0.32.24.dist-info → ez_a_sync-0.32.26.dist-info}/RECORD +67 -67
  65. {ez_a_sync-0.32.24.dist-info → ez_a_sync-0.32.26.dist-info}/WHEEL +0 -0
  66. {ez_a_sync-0.32.24.dist-info → ez_a_sync-0.32.26.dist-info}/licenses/LICENSE.txt +0 -0
  67. {ez_a_sync-0.32.24.dist-info → ez_a_sync-0.32.26.dist-info}/top_level.txt +0 -0
@@ -128,14 +128,17 @@ cdef object ccreate_task(object coro, str name, bint skip_gc_until_done, bint lo
128
128
  persisted = task_factory(loop, persisted)
129
129
  if name:
130
130
  __set_task_name(persisted, name)
131
-
131
+
132
+ persisted.add_done_callback(_persisted_task_callback)
132
133
  _persisted_tasks.add(persisted)
133
134
 
134
135
  if log_destroy_pending is False:
135
136
  task._log_destroy_pending = False
136
137
 
137
- if _persisted_tasks:
138
- __prune_persisted_tasks()
138
+ if _exceptions:
139
+ for task, exc in _exceptions:
140
+ __log_exception(exc)
141
+ raise exc.with_traceback(exc.__traceback__)
139
142
 
140
143
  return task
141
144
 
@@ -145,7 +148,39 @@ cdef inline void __set_task_name(object task, str name):
145
148
  set_name(name)
146
149
 
147
150
 
151
+ def _persisted_task_callback(task: Task[Any]) -> None:
152
+ """Remove completed tasks from the set of persisted tasks.
153
+
154
+ This callback function checks each persisted task as it completes. If a task has a :class:`PersistedTaskException`,
155
+ it logs the exception before discarding the task. If it has any other type of Exception, it adds it to `_exceptions`
156
+ to be raised later.
157
+
158
+ See Also:
159
+ - :class:`PersistedTaskException`
160
+ """
161
+ cdef dict context
162
+ if task.cancelled():
163
+ pass
164
+ elif exc := task.exception():
165
+ if isinstance(exc, PersistedTaskException):
166
+ # we have to manually log the traceback that asyncio would usually log
167
+ # since we already got the exception from the task and the usual handler will now not run
168
+ context = {
169
+ "message": f"{task.__class__.__name__} exception was never retrieved",
170
+ "exception": exc,
171
+ "future": task,
172
+ }
173
+ if task._source_traceback:
174
+ context["source_traceback"] = task._source_traceback
175
+ task._loop.call_exception_handler(context)
176
+ else:
177
+ # force exceptions related to this lib to bubble up
178
+ _exceptions.add((task, exc))
179
+ _persisted_tasks.discard(task)
180
+
181
+
148
182
  cdef public set[object] _persisted_tasks = set()
183
+ cdef public set[tuple[object, object]] _exceptions = set()
149
184
 
150
185
  cdef object __await
151
186
 
@@ -180,46 +215,6 @@ async def __await(awaitable: Awaitable[T]) -> T:
180
215
  cdef object __log_exception = logger.exception
181
216
 
182
217
 
183
- cdef void __prune_persisted_tasks():
184
- """Remove completed tasks from the set of persisted tasks.
185
-
186
- This function checks each task in the persisted tasks set. If a task is done and has an exception,
187
- it logs the exception and raises it if it's not a :class:`PersistedTaskException`. It also logs the traceback
188
- manually since the usual handler will not run after retrieving the exception.
189
-
190
- See Also:
191
- - :class:`PersistedTaskException`
192
- """
193
- cdef object task
194
- cdef dict context
195
- cdef list done = list(filter(_is_done, _persisted_tasks))
196
- if not done:
197
- return
198
- _persisted_tasks.difference_update(done)
199
- for task in done:
200
- exc = _get_exception(task)
201
- if exc is None:
202
- continue
203
- # force exceptions related to this lib to bubble up
204
- if not isinstance(exc, PersistedTaskException):
205
- __log_exception(exc)
206
- raise exc
207
- # we have to manually log the traceback that asyncio would usually log
208
- # since we already got the exception from the task and the usual handler will now not run
209
- context = {
210
- "message": f"{task.__class__.__name__} exception was never retrieved",
211
- "exception": exc,
212
- "future": task,
213
- }
214
- if task._source_traceback:
215
- context["source_traceback"] = task._source_traceback
216
- task._loop.call_exception_handler(context)
217
-
218
-
219
- cdef inline bint _is_done(fut: Future):
220
- return PyUnicode_CompareWithASCIIString(fut._state, b"PENDING") != 0
221
-
222
-
223
218
  cdef object _get_exception(fut: Future):
224
219
  """Return the exception that was set on this future.
225
220