ez-a-sync 0.32.21__cp310-cp310-win_amd64.whl → 0.32.23__cp310-cp310-win_amd64.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 +1266 -1194
- a_sync/_smart.cp310-win_amd64.pyd +0 -0
- a_sync/_smart.pyx +1 -0
- a_sync/a_sync/_descriptor.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_flags.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_helpers.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/_kwargs.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/abstract.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/base.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/decorator.py +89 -0
- a_sync/a_sync/flags.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/function.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/method.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/modifiers/manager.cp310-win_amd64.pyd +0 -0
- a_sync/a_sync/property.cp310-win_amd64.pyd +0 -0
- a_sync/async_property/cached.cp310-win_amd64.pyd +0 -0
- a_sync/async_property/proxy.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/as_completed.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/create_task.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/gather.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/igather.cp310-win_amd64.pyd +0 -0
- a_sync/asyncio/sleep.cp310-win_amd64.pyd +0 -0
- a_sync/debugging.cp310-win_amd64.pyd +0 -0
- a_sync/exceptions.c +480 -263
- a_sync/exceptions.cp310-win_amd64.pyd +0 -0
- a_sync/exceptions.pyx +3 -0
- a_sync/functools.cp310-win_amd64.pyd +0 -0
- a_sync/iter.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/_debug.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/_loggable.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/counter.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/event.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/prio_semaphore.cp310-win_amd64.pyd +0 -0
- a_sync/primitives/locks/semaphore.cp310-win_amd64.pyd +0 -0
- a_sync/utils/repr.cp310-win_amd64.pyd +0 -0
- {ez_a_sync-0.32.21.dist-info → ez_a_sync-0.32.23.dist-info}/METADATA +1 -1
- {ez_a_sync-0.32.21.dist-info → ez_a_sync-0.32.23.dist-info}/RECORD +40 -40
- {ez_a_sync-0.32.21.dist-info → ez_a_sync-0.32.23.dist-info}/WHEEL +0 -0
- {ez_a_sync-0.32.21.dist-info → ez_a_sync-0.32.23.dist-info}/licenses/LICENSE.txt +0 -0
- {ez_a_sync-0.32.21.dist-info → ez_a_sync-0.32.23.dist-info}/top_level.txt +0 -0
|
Binary file
|
a_sync/_smart.pyx
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
a_sync/a_sync/decorator.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# mypy: disable-error-code=valid-type
|
|
2
2
|
# mypy: disable-error-code=misc
|
|
3
|
+
from concurrent.futures import Executor
|
|
3
4
|
from a_sync._typing import *
|
|
4
5
|
from a_sync.a_sync import config
|
|
5
6
|
from a_sync.a_sync.function import (
|
|
@@ -24,6 +25,36 @@ from a_sync.a_sync.function import (
|
|
|
24
25
|
# pass
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
@overload
|
|
29
|
+
def a_sync(
|
|
30
|
+
default: Literal["async"],
|
|
31
|
+
executor: Executor,
|
|
32
|
+
**modifiers: Unpack[ModifierKwargs],
|
|
33
|
+
) -> ASyncDecoratorAsyncDefault:
|
|
34
|
+
"""
|
|
35
|
+
Creates an asynchronous default decorator to run a sync function in an executor.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
default: Specifies the default execution mode as 'async'.
|
|
39
|
+
executor: The executor that will be used to call the sync function.
|
|
40
|
+
**modifiers: Additional keyword arguments to modify the behavior of the decorated function.
|
|
41
|
+
|
|
42
|
+
Examples:
|
|
43
|
+
Basic usage with an asynchronous default:
|
|
44
|
+
|
|
45
|
+
>>> @a_sync(default='async', executor=ThreadPoolExecutor(4))
|
|
46
|
+
... def my_function():
|
|
47
|
+
... return True
|
|
48
|
+
>>> await my_function()
|
|
49
|
+
True
|
|
50
|
+
>>> my_function(sync=True)
|
|
51
|
+
True
|
|
52
|
+
|
|
53
|
+
See Also:
|
|
54
|
+
:class:`ASyncDecoratorAsyncDefault`
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
|
|
27
58
|
@overload
|
|
28
59
|
def a_sync(
|
|
29
60
|
default: Literal["async"],
|
|
@@ -52,6 +83,36 @@ def a_sync(
|
|
|
52
83
|
"""
|
|
53
84
|
|
|
54
85
|
|
|
86
|
+
@overload
|
|
87
|
+
def a_sync(
|
|
88
|
+
default: Literal["sync"],
|
|
89
|
+
executor: Executor,
|
|
90
|
+
**modifiers: Unpack[ModifierKwargs],
|
|
91
|
+
) -> ASyncDecoratorSyncDefault:
|
|
92
|
+
"""
|
|
93
|
+
Creates a synchronous default decorator to run a sync function in an executor when called asynchronously.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
default: Specifies the default execution mode as 'sync'.
|
|
97
|
+
executor: The executor that will be used to call the sync function.
|
|
98
|
+
**modifiers: Additional keyword arguments to modify the behavior of the decorated function.
|
|
99
|
+
|
|
100
|
+
Examples:
|
|
101
|
+
Usage with an executor without specifying a default mode:
|
|
102
|
+
|
|
103
|
+
>>> @a_sync(default="sync", executor=ThreadPoolExecutor(4))
|
|
104
|
+
... def my_function():
|
|
105
|
+
... return True
|
|
106
|
+
>>> my_function()
|
|
107
|
+
True
|
|
108
|
+
>>> await my_function(sync=False)
|
|
109
|
+
True
|
|
110
|
+
|
|
111
|
+
See Also:
|
|
112
|
+
:class:`ASyncDecoratorSyncDefault`
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
|
|
55
116
|
@overload
|
|
56
117
|
def a_sync(
|
|
57
118
|
default: Literal["sync"],
|
|
@@ -80,6 +141,34 @@ def a_sync(
|
|
|
80
141
|
"""
|
|
81
142
|
|
|
82
143
|
|
|
144
|
+
@overload
|
|
145
|
+
def a_sync(
|
|
146
|
+
executor: Executor,
|
|
147
|
+
**modifiers: Unpack[ModifierKwargs],
|
|
148
|
+
) -> ASyncDecoratorSyncDefault:
|
|
149
|
+
"""
|
|
150
|
+
Creates a synchronous default decorator to run a sync function in an executor when called asynchronously.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
executor: The executor that will be used to call the sync function.
|
|
154
|
+
**modifiers: Additional keyword arguments to modify the behavior of the decorated function.
|
|
155
|
+
|
|
156
|
+
Examples:
|
|
157
|
+
Usage with an executor without specifying a default mode:
|
|
158
|
+
|
|
159
|
+
>>> @a_sync(executor=ThreadPoolExecutor(4))
|
|
160
|
+
... def my_function():
|
|
161
|
+
... return True
|
|
162
|
+
>>> my_function()
|
|
163
|
+
True
|
|
164
|
+
>>> await my_function(sync=False)
|
|
165
|
+
True
|
|
166
|
+
|
|
167
|
+
See Also:
|
|
168
|
+
:class:`ASyncDecoratorSyncDefault`
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
|
|
83
172
|
@overload
|
|
84
173
|
def a_sync(
|
|
85
174
|
**modifiers: Unpack[ModifierKwargs],
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|