ez-a-sync 0.32.10__cp310-cp310-musllinux_1_2_i686.whl → 0.32.12__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.
- a_sync/_smart.c +1431 -1560
- a_sync/_smart.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/_smart.pyx +28 -16
- a_sync/a_sync/modifiers/manager.c +614 -937
- a_sync/a_sync/modifiers/manager.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/a_sync/modifiers/manager.pyx +4 -1
- a_sync/a_sync/property.c +250 -244
- a_sync/a_sync/property.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/a_sync/property.pyx +4 -4
- a_sync/asyncio/create_task.c +735 -579
- a_sync/asyncio/create_task.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/asyncio/create_task.pyx +7 -4
- a_sync/primitives/locks/event.c +426 -428
- a_sync/primitives/locks/event.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/primitives/locks/event.pyx +3 -1
- a_sync/primitives/locks/prio_semaphore.c +2623 -1503
- a_sync/primitives/locks/prio_semaphore.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/primitives/locks/prio_semaphore.pxd +9 -8
- a_sync/primitives/locks/prio_semaphore.pyx +65 -22
- a_sync/primitives/locks/semaphore.c +1048 -1051
- a_sync/primitives/locks/semaphore.cpython-310-i386-linux-gnu.so +0 -0
- a_sync/primitives/locks/semaphore.pyx +4 -2
- {ez_a_sync-0.32.10.dist-info → ez_a_sync-0.32.12.dist-info}/METADATA +1 -1
- {ez_a_sync-0.32.10.dist-info → ez_a_sync-0.32.12.dist-info}/RECORD +27 -27
- {ez_a_sync-0.32.10.dist-info → ez_a_sync-0.32.12.dist-info}/WHEEL +0 -0
- {ez_a_sync-0.32.10.dist-info → ez_a_sync-0.32.12.dist-info}/licenses/LICENSE.txt +0 -0
- {ez_a_sync-0.32.10.dist-info → ez_a_sync-0.32.12.dist-info}/top_level.txt +0 -0
|
Binary file
|
a_sync/_smart.pyx
CHANGED
|
@@ -9,14 +9,16 @@ import asyncio
|
|
|
9
9
|
import typing
|
|
10
10
|
import weakref
|
|
11
11
|
from logging import getLogger
|
|
12
|
+
from types import TracebackType
|
|
12
13
|
|
|
13
14
|
cimport cython
|
|
14
15
|
from cpython.object cimport PyObject
|
|
15
16
|
from cpython.ref cimport Py_DECREF, Py_INCREF
|
|
17
|
+
from cpython.unicode cimport PyUnicode_CompareWithASCIIString
|
|
16
18
|
|
|
17
|
-
from a_sync._typing import
|
|
19
|
+
from a_sync._typing import T
|
|
18
20
|
|
|
19
|
-
if TYPE_CHECKING:
|
|
21
|
+
if typing.TYPE_CHECKING:
|
|
20
22
|
from a_sync import SmartProcessingQueue
|
|
21
23
|
|
|
22
24
|
cdef extern from "weakrefobject.h":
|
|
@@ -50,6 +52,7 @@ del getLogger
|
|
|
50
52
|
cdef object Any = typing.Any
|
|
51
53
|
cdef object Generic = typing.Generic
|
|
52
54
|
cdef object Tuple = typing.Tuple
|
|
55
|
+
cdef object Union = typing.Union
|
|
53
56
|
del typing
|
|
54
57
|
|
|
55
58
|
|
|
@@ -153,7 +156,7 @@ cdef inline bint _is_done(fut: Future):
|
|
|
153
156
|
Done means either that a result / exception are available, or that the
|
|
154
157
|
future was cancelled.
|
|
155
158
|
"""
|
|
156
|
-
return
|
|
159
|
+
return PyUnicode_CompareWithASCIIString(fut._state, b"PENDING") != 0
|
|
157
160
|
|
|
158
161
|
|
|
159
162
|
@cython.linetrace(False)
|
|
@@ -163,17 +166,17 @@ cdef inline bint _is_not_done(fut: Future):
|
|
|
163
166
|
Done means either that a result / exception are available, or that the
|
|
164
167
|
future was cancelled.
|
|
165
168
|
"""
|
|
166
|
-
return
|
|
169
|
+
return PyUnicode_CompareWithASCIIString(fut._state, b"PENDING") == 0
|
|
167
170
|
|
|
168
171
|
|
|
169
172
|
@cython.linetrace(False)
|
|
170
173
|
cdef inline bint _is_cancelled(fut: Future):
|
|
171
174
|
"""Return True if the future was cancelled."""
|
|
172
|
-
return
|
|
175
|
+
return PyUnicode_CompareWithASCIIString(fut._state, b"CANCELLED") == 0
|
|
173
176
|
|
|
174
177
|
|
|
175
178
|
@cython.linetrace(False)
|
|
176
|
-
cdef object _get_result(fut:
|
|
179
|
+
cdef object _get_result(fut: Union["SmartFuture", "SmartTask"]):
|
|
177
180
|
"""Return the result this future represents.
|
|
178
181
|
|
|
179
182
|
If the future has been cancelled, raises CancelledError. If the
|
|
@@ -181,13 +184,17 @@ cdef object _get_result(fut: Future):
|
|
|
181
184
|
the future is done and has an exception set, this exception is raised.
|
|
182
185
|
"""
|
|
183
186
|
cdef str state = fut._state
|
|
184
|
-
if state
|
|
185
|
-
fut._Future__log_traceback = False
|
|
187
|
+
if PyUnicode_CompareWithASCIIString(state, b"FINISHED") == 0:
|
|
186
188
|
exc = fut._exception
|
|
187
189
|
if exc is not None:
|
|
188
|
-
|
|
190
|
+
cached_traceback = fut.__traceback__
|
|
191
|
+
if cached_traceback is None:
|
|
192
|
+
fut._Future__log_traceback = False
|
|
193
|
+
cached_traceback = exc.__traceback__
|
|
194
|
+
fut.__traceback__ = cached_traceback
|
|
195
|
+
raise exc.with_traceback(cached_traceback) from exc.__cause__
|
|
189
196
|
return fut._result
|
|
190
|
-
if state
|
|
197
|
+
if PyUnicode_CompareWithASCIIString(state, b"CANCELLED") == 0:
|
|
191
198
|
raise fut._make_cancelled_error()
|
|
192
199
|
raise InvalidStateError('Result is not ready.')
|
|
193
200
|
|
|
@@ -201,10 +208,10 @@ cdef object _get_exception(fut: Future):
|
|
|
201
208
|
InvalidStateError.
|
|
202
209
|
"""
|
|
203
210
|
cdef str state = fut._state
|
|
204
|
-
if state
|
|
211
|
+
if PyUnicode_CompareWithASCIIString(state, b"FINISHED") == 0:
|
|
205
212
|
fut._Future__log_traceback = False
|
|
206
213
|
return fut._exception
|
|
207
|
-
if state
|
|
214
|
+
if PyUnicode_CompareWithASCIIString(state, b"CANCELLED") == 0:
|
|
208
215
|
raise fut._make_cancelled_error()
|
|
209
216
|
raise InvalidStateError('Exception is not set.')
|
|
210
217
|
|
|
@@ -230,6 +237,8 @@ class SmartFuture(Future, Generic[T]):
|
|
|
230
237
|
_key: Optional[Key] = None
|
|
231
238
|
|
|
232
239
|
_waiters: "weakref.WeakSet[SmartTask[T]]"
|
|
240
|
+
|
|
241
|
+
__traceback__: Optional[TracebackType] = None
|
|
233
242
|
|
|
234
243
|
def __init__(
|
|
235
244
|
self,
|
|
@@ -292,7 +301,7 @@ class SmartFuture(Future, Generic[T]):
|
|
|
292
301
|
|
|
293
302
|
def __await__(self) -> Generator[Any, None, T]:
|
|
294
303
|
"""
|
|
295
|
-
Await the
|
|
304
|
+
Await the future, handling waiters and logging.
|
|
296
305
|
|
|
297
306
|
Yields:
|
|
298
307
|
The result of the future or task.
|
|
@@ -408,7 +417,10 @@ class SmartTask(Task, Generic[T]):
|
|
|
408
417
|
See Also:
|
|
409
418
|
- :class:`asyncio.Task`
|
|
410
419
|
"""
|
|
420
|
+
|
|
411
421
|
_waiters: Set["Task[T]"]
|
|
422
|
+
|
|
423
|
+
__traceback__: Optional[TracebackType] = None
|
|
412
424
|
|
|
413
425
|
@cython.linetrace(False)
|
|
414
426
|
def __init__(
|
|
@@ -439,7 +451,7 @@ class SmartTask(Task, Generic[T]):
|
|
|
439
451
|
|
|
440
452
|
def __await__(self) -> Generator[Any, None, T]:
|
|
441
453
|
"""
|
|
442
|
-
Await the
|
|
454
|
+
Await the task, handling waiters and logging.
|
|
443
455
|
|
|
444
456
|
Yields:
|
|
445
457
|
The result of the future or task.
|
|
@@ -623,7 +635,7 @@ cdef tuple _get_done_callbacks(inner: Task, outer: Future):
|
|
|
623
635
|
if _is_cancelled(outer):
|
|
624
636
|
if not _is_cancelled(inner):
|
|
625
637
|
# Mark inner's result as retrieved.
|
|
626
|
-
|
|
638
|
+
inner._Future__log_traceback = False
|
|
627
639
|
return
|
|
628
640
|
|
|
629
641
|
if _is_cancelled(inner):
|
|
@@ -633,7 +645,7 @@ cdef tuple _get_done_callbacks(inner: Task, outer: Future):
|
|
|
633
645
|
if exc is not None:
|
|
634
646
|
outer.set_exception(exc)
|
|
635
647
|
else:
|
|
636
|
-
outer.set_result(
|
|
648
|
+
outer.set_result(inner._result)
|
|
637
649
|
|
|
638
650
|
def _outer_done_callback(outer):
|
|
639
651
|
if _is_not_done(inner):
|