ez-a-sync 0.32.26__cp310-cp310-macosx_11_0_arm64.whl → 0.32.28__cp310-cp310-macosx_11_0_arm64.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 +58 -38
- a_sync/_smart.cpython-310-darwin.so +0 -0
- a_sync/a_sync/_descriptor.c +80 -60
- a_sync/a_sync/_descriptor.cpython-310-darwin.so +0 -0
- a_sync/a_sync/_flags.c +13 -10
- a_sync/a_sync/_flags.cpython-310-darwin.so +0 -0
- a_sync/a_sync/_helpers.c +76 -56
- a_sync/a_sync/_helpers.cpython-310-darwin.so +0 -0
- a_sync/a_sync/_kwargs.c +45 -25
- a_sync/a_sync/_kwargs.cpython-310-darwin.so +0 -0
- a_sync/a_sync/abstract.c +54 -24
- a_sync/a_sync/abstract.cpython-310-darwin.so +0 -0
- a_sync/a_sync/abstract.pyi +2 -2
- a_sync/a_sync/base.c +186 -162
- a_sync/a_sync/base.cpython-310-darwin.so +0 -0
- a_sync/a_sync/flags.c +13 -10
- a_sync/a_sync/flags.cpython-310-darwin.so +0 -0
- a_sync/a_sync/function.c +104 -75
- a_sync/a_sync/function.cpython-310-darwin.so +0 -0
- a_sync/a_sync/method.c +157 -125
- a_sync/a_sync/method.cpython-310-darwin.so +0 -0
- a_sync/a_sync/method.pyi +2 -1
- a_sync/a_sync/modifiers/manager.c +60 -40
- a_sync/a_sync/modifiers/manager.cpython-310-darwin.so +0 -0
- a_sync/a_sync/property.c +104 -78
- a_sync/a_sync/property.cpython-310-darwin.so +0 -0
- a_sync/async_property/cached.c +66 -46
- a_sync/async_property/cached.cpython-310-darwin.so +0 -0
- a_sync/async_property/proxy.c +36 -16
- a_sync/async_property/proxy.cpython-310-darwin.so +0 -0
- a_sync/asyncio/as_completed.c +33 -13
- a_sync/asyncio/as_completed.cpython-310-darwin.so +0 -0
- a_sync/asyncio/create_task.c +59 -21
- a_sync/asyncio/create_task.cpython-310-darwin.so +0 -0
- a_sync/asyncio/gather.c +42 -22
- a_sync/asyncio/gather.cpython-310-darwin.so +0 -0
- a_sync/asyncio/igather.c +42 -18
- a_sync/asyncio/igather.cpython-310-darwin.so +0 -0
- a_sync/asyncio/sleep.c +24 -4
- a_sync/asyncio/sleep.cpython-310-darwin.so +0 -0
- a_sync/debugging.c +52 -32
- a_sync/debugging.cpython-310-darwin.so +0 -0
- a_sync/exceptions.c +36 -20
- a_sync/exceptions.cpython-310-darwin.so +0 -0
- a_sync/executor.py +44 -0
- a_sync/functools.c +36 -16
- a_sync/functools.cpython-310-darwin.so +0 -0
- a_sync/iter.c +166 -96
- a_sync/iter.cpython-310-darwin.so +0 -0
- a_sync/primitives/_debug.c +65 -45
- a_sync/primitives/_debug.cpython-310-darwin.so +0 -0
- a_sync/primitives/_loggable.c +46 -20
- a_sync/primitives/_loggable.cpython-310-darwin.so +0 -0
- a_sync/primitives/locks/counter.c +98 -68
- a_sync/primitives/locks/counter.cpython-310-darwin.so +0 -0
- a_sync/primitives/locks/event.c +75 -54
- a_sync/primitives/locks/event.cpython-310-darwin.so +0 -0
- a_sync/primitives/locks/prio_semaphore.c +121 -81
- a_sync/primitives/locks/prio_semaphore.cpython-310-darwin.so +0 -0
- a_sync/primitives/locks/prio_semaphore.pyi +2 -2
- a_sync/primitives/locks/semaphore.c +94 -67
- a_sync/primitives/locks/semaphore.cpython-310-darwin.so +0 -0
- a_sync/primitives/locks/semaphore.pyi +10 -9
- a_sync/primitives/queue.py +5 -1
- a_sync/utils/repr.c +55 -35
- a_sync/utils/repr.cpython-310-darwin.so +0 -0
- {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.28.dist-info}/METADATA +1 -1
- {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.28.dist-info}/RECORD +71 -71
- {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.28.dist-info}/WHEEL +0 -0
- {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.28.dist-info}/licenses/LICENSE.txt +0 -0
- {ez_a_sync-0.32.26.dist-info → ez_a_sync-0.32.28.dist-info}/top_level.txt +0 -0
a_sync/asyncio/sleep.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.4 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -29,8 +29,8 @@ END: Cython Metadata */
|
|
|
29
29
|
#elif PY_VERSION_HEX < 0x03080000
|
|
30
30
|
#error Cython requires Python 3.8+.
|
|
31
31
|
#else
|
|
32
|
-
#define __PYX_ABI_VERSION "
|
|
33
|
-
#define CYTHON_HEX_VERSION
|
|
32
|
+
#define __PYX_ABI_VERSION "3_1_4"
|
|
33
|
+
#define CYTHON_HEX_VERSION 0x030104F0
|
|
34
34
|
#define CYTHON_FUTURE_DIVISION 1
|
|
35
35
|
/* CModulePreamble */
|
|
36
36
|
#include <stddef.h>
|
|
@@ -393,6 +393,9 @@ END: Cython Metadata */
|
|
|
393
393
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
394
394
|
#endif
|
|
395
395
|
#endif
|
|
396
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
397
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
398
|
+
#endif
|
|
396
399
|
#ifndef __has_attribute
|
|
397
400
|
#define __has_attribute(x) 0
|
|
398
401
|
#endif
|
|
@@ -5666,6 +5669,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
5666
5669
|
changed = 1;
|
|
5667
5670
|
}
|
|
5668
5671
|
#endif // CYTHON_METH_FASTCALL
|
|
5672
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
5669
5673
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
5670
5674
|
PyObject *descr;
|
|
5671
5675
|
assert(memb->type == T_OBJECT);
|
|
@@ -5680,11 +5684,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
5680
5684
|
}
|
|
5681
5685
|
changed = 1;
|
|
5682
5686
|
}
|
|
5687
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
5683
5688
|
}
|
|
5684
5689
|
memb++;
|
|
5685
5690
|
}
|
|
5686
5691
|
}
|
|
5687
5692
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
5693
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
5688
5694
|
slot = spec->slots;
|
|
5689
5695
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
5690
5696
|
slot++;
|
|
@@ -5716,6 +5722,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
5716
5722
|
++getset;
|
|
5717
5723
|
}
|
|
5718
5724
|
}
|
|
5725
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
5719
5726
|
if (changed)
|
|
5720
5727
|
PyType_Modified(type);
|
|
5721
5728
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -5826,6 +5833,13 @@ try_unpack:
|
|
|
5826
5833
|
|
|
5827
5834
|
/* PyObjectCallMethod0 */
|
|
5828
5835
|
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
|
5836
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
5837
|
+
PyObject *args[1] = {obj};
|
|
5838
|
+
(void) __Pyx_PyObject_GetMethod;
|
|
5839
|
+
(void) __Pyx_PyObject_CallOneArg;
|
|
5840
|
+
(void) __Pyx_PyObject_CallNoArg;
|
|
5841
|
+
return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
5842
|
+
#else
|
|
5829
5843
|
PyObject *method = NULL, *result = NULL;
|
|
5830
5844
|
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
|
5831
5845
|
if (likely(is_method)) {
|
|
@@ -5838,6 +5852,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name
|
|
|
5838
5852
|
Py_DECREF(method);
|
|
5839
5853
|
bad:
|
|
5840
5854
|
return result;
|
|
5855
|
+
#endif
|
|
5841
5856
|
}
|
|
5842
5857
|
|
|
5843
5858
|
/* ValidateBasesTuple */
|
|
@@ -6405,7 +6420,7 @@ bad:
|
|
|
6405
6420
|
}
|
|
6406
6421
|
|
|
6407
6422
|
/* CommonTypesMetaclass */
|
|
6408
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
6423
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
6409
6424
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
6410
6425
|
}
|
|
6411
6426
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
@@ -6434,6 +6449,7 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
|
|
|
6434
6449
|
return -1;
|
|
6435
6450
|
}
|
|
6436
6451
|
mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
|
|
6452
|
+
Py_DECREF(bases);
|
|
6437
6453
|
if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
|
|
6438
6454
|
return -1;
|
|
6439
6455
|
}
|
|
@@ -8826,6 +8842,10 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
|
|
|
8826
8842
|
PyCode_NewWithPosOnlyArgs
|
|
8827
8843
|
#endif
|
|
8828
8844
|
(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
|
|
8845
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
|
|
8846
|
+
if (likely(result))
|
|
8847
|
+
result->_co_firsttraceable = 0;
|
|
8848
|
+
#endif
|
|
8829
8849
|
return result;
|
|
8830
8850
|
}
|
|
8831
8851
|
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
|
|
Binary file
|
a_sync/debugging.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.4 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -30,8 +30,8 @@ END: Cython Metadata */
|
|
|
30
30
|
#elif PY_VERSION_HEX < 0x03080000
|
|
31
31
|
#error Cython requires Python 3.8+.
|
|
32
32
|
#else
|
|
33
|
-
#define __PYX_ABI_VERSION "
|
|
34
|
-
#define CYTHON_HEX_VERSION
|
|
33
|
+
#define __PYX_ABI_VERSION "3_1_4"
|
|
34
|
+
#define CYTHON_HEX_VERSION 0x030104F0
|
|
35
35
|
#define CYTHON_FUTURE_DIVISION 1
|
|
36
36
|
/* CModulePreamble */
|
|
37
37
|
#include <stddef.h>
|
|
@@ -394,6 +394,9 @@ END: Cython Metadata */
|
|
|
394
394
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
395
395
|
#endif
|
|
396
396
|
#endif
|
|
397
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
398
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
399
|
+
#endif
|
|
397
400
|
#ifndef __has_attribute
|
|
398
401
|
#define __has_attribute(x) 0
|
|
399
402
|
#endif
|
|
@@ -2364,22 +2367,22 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs
|
|
|
2364
2367
|
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
|
|
2365
2368
|
|
|
2366
2369
|
/* TypeImport.proto */
|
|
2367
|
-
#ifndef
|
|
2368
|
-
#define
|
|
2370
|
+
#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_4
|
|
2371
|
+
#define __PYX_HAVE_RT_ImportType_proto_3_1_4
|
|
2369
2372
|
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
|
2370
2373
|
#include <stdalign.h>
|
|
2371
2374
|
#endif
|
|
2372
2375
|
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
|
|
2373
|
-
#define
|
|
2376
|
+
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) alignof(s)
|
|
2374
2377
|
#else
|
|
2375
|
-
#define
|
|
2378
|
+
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) sizeof(void*)
|
|
2376
2379
|
#endif
|
|
2377
|
-
enum
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2380
|
+
enum __Pyx_ImportType_CheckSize_3_1_4 {
|
|
2381
|
+
__Pyx_ImportType_CheckSize_Error_3_1_4 = 0,
|
|
2382
|
+
__Pyx_ImportType_CheckSize_Warn_3_1_4 = 1,
|
|
2383
|
+
__Pyx_ImportType_CheckSize_Ignore_3_1_4 = 2
|
|
2381
2384
|
};
|
|
2382
|
-
static PyTypeObject *
|
|
2385
|
+
static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size);
|
|
2383
2386
|
#endif
|
|
2384
2387
|
|
|
2385
2388
|
/* GetVTable.proto */
|
|
@@ -6220,27 +6223,27 @@ static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
|
|
|
6220
6223
|
/*--- Type import code ---*/
|
|
6221
6224
|
__pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
|
|
6222
6225
|
__Pyx_GOTREF(__pyx_t_1);
|
|
6223
|
-
__pyx_mstate->__pyx_ptype_7cpython_4type_type =
|
|
6226
|
+
__pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
|
|
6224
6227
|
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
|
|
6225
|
-
sizeof(PyTypeObject),
|
|
6228
|
+
sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyTypeObject),
|
|
6226
6229
|
#elif CYTHON_COMPILING_IN_LIMITED_API
|
|
6227
6230
|
0, 0,
|
|
6228
6231
|
#else
|
|
6229
|
-
sizeof(PyHeapTypeObject),
|
|
6232
|
+
sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyHeapTypeObject),
|
|
6230
6233
|
#endif
|
|
6231
|
-
|
|
6234
|
+
__Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
|
|
6232
6235
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
6233
6236
|
__pyx_t_1 = PyImport_ImportModule("a_sync.iter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
|
|
6234
6237
|
__Pyx_GOTREF(__pyx_t_1);
|
|
6235
|
-
__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction =
|
|
6238
|
+
__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction = __Pyx_ImportType_3_1_4(__pyx_t_1, "a_sync.iter", "_ASyncGeneratorFunction",
|
|
6236
6239
|
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
|
|
6237
|
-
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6240
|
+
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6238
6241
|
#elif CYTHON_COMPILING_IN_LIMITED_API
|
|
6239
|
-
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6242
|
+
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6240
6243
|
#else
|
|
6241
|
-
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6244
|
+
sizeof(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(struct __pyx_obj_6a_sync_4iter__ASyncGeneratorFunction),
|
|
6242
6245
|
#endif
|
|
6243
|
-
|
|
6246
|
+
__Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction) __PYX_ERR(2, 3, __pyx_L1_error)
|
|
6244
6247
|
__pyx_vtabptr_6a_sync_4iter__ASyncGeneratorFunction = (struct __pyx_vtabstruct_6a_sync_4iter__ASyncGeneratorFunction*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_6a_sync_4iter__ASyncGeneratorFunction); if (unlikely(!__pyx_vtabptr_6a_sync_4iter__ASyncGeneratorFunction)) __PYX_ERR(2, 3, __pyx_L1_error)
|
|
6245
6248
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
6246
6249
|
__Pyx_RefNannyFinishContext();
|
|
@@ -8928,6 +8931,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
|
|
|
8928
8931
|
changed = 1;
|
|
8929
8932
|
}
|
|
8930
8933
|
#endif // CYTHON_METH_FASTCALL
|
|
8934
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
8931
8935
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
8932
8936
|
PyObject *descr;
|
|
8933
8937
|
assert(memb->type == T_OBJECT);
|
|
@@ -8942,11 +8946,13 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
|
|
|
8942
8946
|
}
|
|
8943
8947
|
changed = 1;
|
|
8944
8948
|
}
|
|
8949
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
8945
8950
|
}
|
|
8946
8951
|
memb++;
|
|
8947
8952
|
}
|
|
8948
8953
|
}
|
|
8949
8954
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
8955
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
8950
8956
|
slot = spec->slots;
|
|
8951
8957
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
8952
8958
|
slot++;
|
|
@@ -8978,6 +8984,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
|
|
|
8978
8984
|
++getset;
|
|
8979
8985
|
}
|
|
8980
8986
|
}
|
|
8987
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
8981
8988
|
if (changed)
|
|
8982
8989
|
PyType_Modified(type);
|
|
8983
8990
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -9110,7 +9117,7 @@ bad:
|
|
|
9110
9117
|
}
|
|
9111
9118
|
|
|
9112
9119
|
/* CommonTypesMetaclass */
|
|
9113
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
9120
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
9114
9121
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
9115
9122
|
}
|
|
9116
9123
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
@@ -9139,6 +9146,7 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
|
|
|
9139
9146
|
return -1;
|
|
9140
9147
|
}
|
|
9141
9148
|
mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
|
|
9149
|
+
Py_DECREF(bases);
|
|
9142
9150
|
if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
|
|
9143
9151
|
return -1;
|
|
9144
9152
|
}
|
|
@@ -9438,7 +9446,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
|
|
|
9438
9446
|
}
|
|
9439
9447
|
|
|
9440
9448
|
/* PyObjectCallMethod1 */
|
|
9441
|
-
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
9449
|
+
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
|
|
9442
9450
|
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
9443
9451
|
PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
|
|
9444
9452
|
Py_DECREF(method);
|
|
@@ -9446,7 +9454,7 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
|
|
|
9446
9454
|
}
|
|
9447
9455
|
#endif
|
|
9448
9456
|
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
|
|
9449
|
-
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
|
|
9457
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
9450
9458
|
PyObject *args[2] = {obj, arg};
|
|
9451
9459
|
(void) __Pyx_PyObject_GetMethod;
|
|
9452
9460
|
(void) __Pyx_PyObject_CallOneArg;
|
|
@@ -12269,6 +12277,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObje
|
|
|
12269
12277
|
|
|
12270
12278
|
/* PyObjectCallMethod0 */
|
|
12271
12279
|
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
|
12280
|
+
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
|
|
12281
|
+
PyObject *args[1] = {obj};
|
|
12282
|
+
(void) __Pyx_PyObject_GetMethod;
|
|
12283
|
+
(void) __Pyx_PyObject_CallOneArg;
|
|
12284
|
+
(void) __Pyx_PyObject_CallNoArg;
|
|
12285
|
+
return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
12286
|
+
#else
|
|
12272
12287
|
PyObject *method = NULL, *result = NULL;
|
|
12273
12288
|
int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
|
12274
12289
|
if (likely(is_method)) {
|
|
@@ -12281,6 +12296,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_TrueDivideObjC(PyObject *op1, PyObje
|
|
|
12281
12296
|
Py_DECREF(method);
|
|
12282
12297
|
bad:
|
|
12283
12298
|
return result;
|
|
12299
|
+
#endif
|
|
12284
12300
|
}
|
|
12285
12301
|
|
|
12286
12302
|
/* ValidateBasesTuple */
|
|
@@ -12454,15 +12470,15 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
|
|
|
12454
12470
|
}
|
|
12455
12471
|
|
|
12456
12472
|
/* TypeImport */
|
|
12457
|
-
#ifndef
|
|
12458
|
-
#define
|
|
12459
|
-
static PyTypeObject *
|
|
12460
|
-
size_t size, size_t alignment, enum
|
|
12473
|
+
#ifndef __PYX_HAVE_RT_ImportType_3_1_4
|
|
12474
|
+
#define __PYX_HAVE_RT_ImportType_3_1_4
|
|
12475
|
+
static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject *module, const char *module_name, const char *class_name,
|
|
12476
|
+
size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size)
|
|
12461
12477
|
{
|
|
12462
12478
|
PyObject *result = 0;
|
|
12463
12479
|
Py_ssize_t basicsize;
|
|
12464
12480
|
Py_ssize_t itemsize;
|
|
12465
|
-
#
|
|
12481
|
+
#ifdef Py_LIMITED_API
|
|
12466
12482
|
PyObject *py_basicsize;
|
|
12467
12483
|
PyObject *py_itemsize;
|
|
12468
12484
|
#endif
|
|
@@ -12475,7 +12491,7 @@ static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module
|
|
|
12475
12491
|
module_name, class_name);
|
|
12476
12492
|
goto bad;
|
|
12477
12493
|
}
|
|
12478
|
-
#
|
|
12494
|
+
#ifndef Py_LIMITED_API
|
|
12479
12495
|
basicsize = ((PyTypeObject *)result)->tp_basicsize;
|
|
12480
12496
|
itemsize = ((PyTypeObject *)result)->tp_itemsize;
|
|
12481
12497
|
#else
|
|
@@ -12513,7 +12529,7 @@ static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module
|
|
|
12513
12529
|
module_name, class_name, size, basicsize+itemsize);
|
|
12514
12530
|
goto bad;
|
|
12515
12531
|
}
|
|
12516
|
-
if (check_size ==
|
|
12532
|
+
if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_4 &&
|
|
12517
12533
|
((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
|
|
12518
12534
|
PyErr_Format(PyExc_ValueError,
|
|
12519
12535
|
"%.200s.%.200s size changed, may indicate binary incompatibility. "
|
|
@@ -12521,7 +12537,7 @@ static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject *module, const char *module
|
|
|
12521
12537
|
module_name, class_name, size, basicsize, basicsize+itemsize);
|
|
12522
12538
|
goto bad;
|
|
12523
12539
|
}
|
|
12524
|
-
else if (check_size ==
|
|
12540
|
+
else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_4 && (size_t)basicsize > size) {
|
|
12525
12541
|
if (PyErr_WarnFormat(NULL, 0,
|
|
12526
12542
|
"%.200s.%.200s size changed, may indicate binary incompatibility. "
|
|
12527
12543
|
"Expected %zd from C header, got %zd from PyObject",
|
|
@@ -14639,6 +14655,10 @@ static int __pyx_AsyncGen_init(PyObject *module) {
|
|
|
14639
14655
|
PyCode_NewWithPosOnlyArgs
|
|
14640
14656
|
#endif
|
|
14641
14657
|
(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
|
|
14658
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
|
|
14659
|
+
if (likely(result))
|
|
14660
|
+
result->_co_firsttraceable = 0;
|
|
14661
|
+
#endif
|
|
14642
14662
|
return result;
|
|
14643
14663
|
}
|
|
14644
14664
|
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
|
|
Binary file
|
a_sync/exceptions.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.4 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -29,8 +29,8 @@ END: Cython Metadata */
|
|
|
29
29
|
#elif PY_VERSION_HEX < 0x03080000
|
|
30
30
|
#error Cython requires Python 3.8+.
|
|
31
31
|
#else
|
|
32
|
-
#define __PYX_ABI_VERSION "
|
|
33
|
-
#define CYTHON_HEX_VERSION
|
|
32
|
+
#define __PYX_ABI_VERSION "3_1_4"
|
|
33
|
+
#define CYTHON_HEX_VERSION 0x030104F0
|
|
34
34
|
#define CYTHON_FUTURE_DIVISION 1
|
|
35
35
|
/* CModulePreamble */
|
|
36
36
|
#include <stddef.h>
|
|
@@ -393,6 +393,9 @@ END: Cython Metadata */
|
|
|
393
393
|
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
394
394
|
#endif
|
|
395
395
|
#endif
|
|
396
|
+
#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME
|
|
397
|
+
#define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100
|
|
398
|
+
#endif
|
|
396
399
|
#ifndef __has_attribute
|
|
397
400
|
#define __has_attribute(x) 0
|
|
398
401
|
#endif
|
|
@@ -1935,18 +1938,18 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
|
|
|
1935
1938
|
if (!__Pyx_PyThreadState_Current->tracing) {\
|
|
1936
1939
|
if (likely(__pyx_frame_code)) Py_INCREF(__pyx_frame_code);\
|
|
1937
1940
|
else __pyx_frame_code = (PyObject*) __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);\
|
|
1938
|
-
if (unlikely(!__pyx_frame_code))
|
|
1939
|
-
ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
|
|
1940
|
-
}
|
|
1941
|
+
if (unlikely(!__pyx_frame_code)) ret = -1;\
|
|
1942
|
+
else ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
|
|
1943
|
+
} else __pyx_frame_code = NULL;\
|
|
1941
1944
|
PyGILState_Release(state);\
|
|
1942
|
-
}
|
|
1945
|
+
} else __pyx_frame_code = NULL;\
|
|
1943
1946
|
} else {\
|
|
1944
1947
|
if (!__Pyx_PyThreadState_Current->tracing) {\
|
|
1945
1948
|
if (likely(__pyx_frame_code)) Py_INCREF(__pyx_frame_code);\
|
|
1946
1949
|
else __pyx_frame_code = (PyObject*) __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);\
|
|
1947
|
-
if (unlikely(!__pyx_frame_code))
|
|
1948
|
-
ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
|
|
1949
|
-
}
|
|
1950
|
+
if (unlikely(!__pyx_frame_code)) ret = -1;\
|
|
1951
|
+
else ret = __Pyx__TraceStartFunc(__pyx_pymonitoring_state, __pyx_frame_code, offset, skip_event);\
|
|
1952
|
+
} else __pyx_frame_code = NULL;\
|
|
1950
1953
|
}\
|
|
1951
1954
|
if (unlikely(ret == -1)) goto_error;\
|
|
1952
1955
|
}
|
|
@@ -2704,7 +2707,7 @@ static unsigned long __Pyx_get_runtime_version(void);
|
|
|
2704
2707
|
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
|
|
2705
2708
|
|
|
2706
2709
|
/* VoidPtrImport.proto */
|
|
2707
|
-
static int
|
|
2710
|
+
static int __Pyx_ImportVoidPtr_3_1_4(PyObject *module, const char *name, void **p, const char *sig);
|
|
2708
2711
|
|
|
2709
2712
|
/* MultiPhaseInitModuleState.proto */
|
|
2710
2713
|
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
|
|
@@ -5234,8 +5237,12 @@ static PyObject *__pyx_pf_6a_sync_10exceptions_27SyncModeInAsyncContextError___i
|
|
|
5234
5237
|
* err += f"Check your traceback to determine which, then try calling asynchronously instead with one of the following kwargs:\n"
|
|
5235
5238
|
*/
|
|
5236
5239
|
__Pyx_TraceLine(320,5,0,__PYX_ERR(0, 320, __pyx_L1_error))
|
|
5237
|
-
|
|
5238
|
-
|
|
5240
|
+
{
|
|
5241
|
+
Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_err);
|
|
5242
|
+
if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 320, __pyx_L1_error)
|
|
5243
|
+
__pyx_t_1 = (__pyx_temp != 0);
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5239
5246
|
__pyx_t_2 = (!__pyx_t_1);
|
|
5240
5247
|
if (__pyx_t_2) {
|
|
5241
5248
|
|
|
@@ -6224,9 +6231,9 @@ static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
|
|
|
6224
6231
|
/*--- Variable import code ---*/
|
|
6225
6232
|
__pyx_t_1 = PyImport_ImportModule("a_sync.a_sync.flags"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
6226
6233
|
__Pyx_GOTREF(__pyx_t_1);
|
|
6227
|
-
if (
|
|
6228
|
-
if (
|
|
6229
|
-
if (
|
|
6234
|
+
if (__Pyx_ImportVoidPtr_3_1_4(__pyx_t_1, "AFFIRMATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_AFFIRMATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
6235
|
+
if (__Pyx_ImportVoidPtr_3_1_4(__pyx_t_1, "NEGATIVE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_NEGATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
6236
|
+
if (__Pyx_ImportVoidPtr_3_1_4(__pyx_t_1, "VIABLE_FLAGS", (void **)&__pyx_vp_6a_sync_6a_sync_5flags_VIABLE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
6230
6237
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
6231
6238
|
__Pyx_RefNannyFinishContext();
|
|
6232
6239
|
return 0;
|
|
@@ -9867,6 +9874,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
9867
9874
|
changed = 1;
|
|
9868
9875
|
}
|
|
9869
9876
|
#endif // CYTHON_METH_FASTCALL
|
|
9877
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
9870
9878
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
9871
9879
|
PyObject *descr;
|
|
9872
9880
|
assert(memb->type == T_OBJECT);
|
|
@@ -9881,11 +9889,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
9881
9889
|
}
|
|
9882
9890
|
changed = 1;
|
|
9883
9891
|
}
|
|
9892
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
9884
9893
|
}
|
|
9885
9894
|
memb++;
|
|
9886
9895
|
}
|
|
9887
9896
|
}
|
|
9888
9897
|
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
9898
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
9889
9899
|
slot = spec->slots;
|
|
9890
9900
|
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
9891
9901
|
slot++;
|
|
@@ -9917,6 +9927,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
9917
9927
|
++getset;
|
|
9918
9928
|
}
|
|
9919
9929
|
}
|
|
9930
|
+
#endif // !CYTHON_COMPILING_IN_PYPY
|
|
9920
9931
|
if (changed)
|
|
9921
9932
|
PyType_Modified(type);
|
|
9922
9933
|
#endif // PY_VERSION_HEX > 0x030900B1
|
|
@@ -10049,7 +10060,7 @@ bad:
|
|
|
10049
10060
|
}
|
|
10050
10061
|
|
|
10051
10062
|
/* CommonTypesMetaclass */
|
|
10052
|
-
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
10063
|
+
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
10053
10064
|
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
10054
10065
|
}
|
|
10055
10066
|
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
@@ -10078,6 +10089,7 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
|
|
|
10078
10089
|
return -1;
|
|
10079
10090
|
}
|
|
10080
10091
|
mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
|
|
10092
|
+
Py_DECREF(bases);
|
|
10081
10093
|
if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
|
|
10082
10094
|
return -1;
|
|
10083
10095
|
}
|
|
@@ -12446,9 +12458,9 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
|
|
|
12446
12458
|
}
|
|
12447
12459
|
|
|
12448
12460
|
/* VoidPtrImport */
|
|
12449
|
-
#ifndef
|
|
12450
|
-
#define
|
|
12451
|
-
static int
|
|
12461
|
+
#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_1_4
|
|
12462
|
+
#define __PYX_HAVE_RT_ImportVoidPtr_3_1_4
|
|
12463
|
+
static int __Pyx_ImportVoidPtr_3_1_4(PyObject *module, const char *name, void **p, const char *sig) {
|
|
12452
12464
|
PyObject *d = 0;
|
|
12453
12465
|
PyObject *cobj = 0;
|
|
12454
12466
|
d = PyObject_GetAttrString(module, "__pyx_capi__");
|
|
@@ -12545,6 +12557,10 @@ bad:
|
|
|
12545
12557
|
PyCode_NewWithPosOnlyArgs
|
|
12546
12558
|
#endif
|
|
12547
12559
|
(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
|
|
12560
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
|
|
12561
|
+
if (likely(result))
|
|
12562
|
+
result->_co_firsttraceable = 0;
|
|
12563
|
+
#endif
|
|
12548
12564
|
return result;
|
|
12549
12565
|
}
|
|
12550
12566
|
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
|
|
Binary file
|
a_sync/executor.py
CHANGED
|
@@ -15,9 +15,11 @@ See Also:
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import asyncio
|
|
18
|
+
import atexit
|
|
18
19
|
import concurrent.futures
|
|
19
20
|
import multiprocessing.context
|
|
20
21
|
import queue
|
|
22
|
+
import signal
|
|
21
23
|
import threading
|
|
22
24
|
import weakref
|
|
23
25
|
from asyncio import sleep
|
|
@@ -27,6 +29,47 @@ from concurrent.futures import _base, thread
|
|
|
27
29
|
from a_sync._typing import *
|
|
28
30
|
from a_sync.primitives._debug import _DebugDaemonMixin
|
|
29
31
|
|
|
32
|
+
# === Executor Shutdown Logic ===
|
|
33
|
+
# All executors (module-level and user-created) are registered for shutdown on interpreter exit and signals.
|
|
34
|
+
# Signal handlers are chainable: after our cleanup, the previous handler is called (unless SIG_DFL or SIG_IGN).
|
|
35
|
+
# This ensures compatibility with other libraries and deduplicates shutdown logic.
|
|
36
|
+
|
|
37
|
+
_EXECUTORS = set()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def register_executor(executor) -> None:
|
|
41
|
+
"""Register an executor for shutdown on exit/signals."""
|
|
42
|
+
_EXECUTORS.add(executor)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _shutdown_all_executors(*args) -> None:
|
|
46
|
+
"""Shutdown all registered executors (non-blocking)."""
|
|
47
|
+
for executor in list(_EXECUTORS):
|
|
48
|
+
try:
|
|
49
|
+
executor.shutdown(wait=False)
|
|
50
|
+
except Exception:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _register_executor_shutdown() -> None:
|
|
55
|
+
"""Register atexit and chainable signal handlers for executor shutdown."""
|
|
56
|
+
atexit.register(_shutdown_all_executors)
|
|
57
|
+
|
|
58
|
+
def make_chainable_signal_handler(signalnum):
|
|
59
|
+
prev_handler = signal.getsignal(signalnum)
|
|
60
|
+
|
|
61
|
+
def handler(signum, frame):
|
|
62
|
+
_shutdown_all_executors()
|
|
63
|
+
if callable(prev_handler) and prev_handler not in (signal.SIG_DFL, signal.SIG_IGN):
|
|
64
|
+
prev_handler(signum, frame)
|
|
65
|
+
|
|
66
|
+
signal.signal(signalnum, handler)
|
|
67
|
+
|
|
68
|
+
make_chainable_signal_handler(signal.SIGINT)
|
|
69
|
+
make_chainable_signal_handler(signal.SIGTERM)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
_register_executor_shutdown()
|
|
30
73
|
|
|
31
74
|
TEN_MINUTES = 60 * 10
|
|
32
75
|
|
|
@@ -209,6 +252,7 @@ class _AsyncExecutorMixin(concurrent.futures.Executor, _DebugDaemonMixin):
|
|
|
209
252
|
def __init_mixin__(self):
|
|
210
253
|
self.sync_mode = self._max_workers == 0
|
|
211
254
|
self.__super_submit = super().submit
|
|
255
|
+
register_executor(self)
|
|
212
256
|
|
|
213
257
|
async def _debug_daemon(self, fut: asyncio.Future, fn, *args, **kwargs) -> None:
|
|
214
258
|
"""
|