ez-a-sync 0.32.25__cp38-cp38-musllinux_1_2_i686.whl → 0.32.27__cp38-cp38-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 +9063 -8837
  2. a_sync/_smart.cpython-38-i386-linux-gnu.so +0 -0
  3. a_sync/a_sync/_descriptor.c +7787 -7011
  4. a_sync/a_sync/_descriptor.cpython-38-i386-linux-gnu.so +0 -0
  5. a_sync/a_sync/_flags.c +1806 -1528
  6. a_sync/a_sync/_flags.cpython-38-i386-linux-gnu.so +0 -0
  7. a_sync/a_sync/_helpers.c +4716 -4173
  8. a_sync/a_sync/_helpers.cpython-38-i386-linux-gnu.so +0 -0
  9. a_sync/a_sync/_kwargs.c +5017 -3786
  10. a_sync/a_sync/_kwargs.cpython-38-i386-linux-gnu.so +0 -0
  11. a_sync/a_sync/abstract.c +5024 -4138
  12. a_sync/a_sync/abstract.cpython-38-i386-linux-gnu.so +0 -0
  13. a_sync/a_sync/base.c +5982 -5010
  14. a_sync/a_sync/base.cpython-38-i386-linux-gnu.so +0 -0
  15. a_sync/a_sync/flags.c +2303 -1405
  16. a_sync/a_sync/flags.cpython-38-i386-linux-gnu.so +0 -0
  17. a_sync/a_sync/function.c +14448 -14471
  18. a_sync/a_sync/function.cpython-38-i386-linux-gnu.so +0 -0
  19. a_sync/a_sync/method.c +10891 -11483
  20. a_sync/a_sync/method.cpython-38-i386-linux-gnu.so +0 -0
  21. a_sync/a_sync/modifiers/manager.c +6700 -5360
  22. a_sync/a_sync/modifiers/manager.cpython-38-i386-linux-gnu.so +0 -0
  23. a_sync/a_sync/property.c +12830 -13699
  24. a_sync/a_sync/property.cpython-38-i386-linux-gnu.so +0 -0
  25. a_sync/a_sync/property.pyx +2 -3
  26. a_sync/async_property/cached.c +7498 -7763
  27. a_sync/async_property/cached.cpython-38-i386-linux-gnu.so +0 -0
  28. a_sync/async_property/proxy.c +12655 -14315
  29. a_sync/async_property/proxy.cpython-38-i386-linux-gnu.so +0 -0
  30. a_sync/asyncio/as_completed.c +7112 -6773
  31. a_sync/asyncio/as_completed.cpython-38-i386-linux-gnu.so +0 -0
  32. a_sync/asyncio/create_task.c +6119 -5206
  33. a_sync/asyncio/create_task.cpython-38-i386-linux-gnu.so +0 -0
  34. a_sync/asyncio/gather.c +6347 -5697
  35. a_sync/asyncio/gather.cpython-38-i386-linux-gnu.so +0 -0
  36. a_sync/asyncio/igather.c +5220 -4624
  37. a_sync/asyncio/igather.cpython-38-i386-linux-gnu.so +0 -0
  38. a_sync/asyncio/sleep.c +3667 -3087
  39. a_sync/asyncio/sleep.cpython-38-i386-linux-gnu.so +0 -0
  40. a_sync/debugging.c +6026 -5874
  41. a_sync/debugging.cpython-38-i386-linux-gnu.so +0 -0
  42. a_sync/exceptions.c +5406 -5368
  43. a_sync/exceptions.cpython-38-i386-linux-gnu.so +0 -0
  44. a_sync/executor.py +44 -0
  45. a_sync/functools.c +5124 -4057
  46. a_sync/functools.cpython-38-i386-linux-gnu.so +0 -0
  47. a_sync/iter.c +14595 -14787
  48. a_sync/iter.cpython-38-i386-linux-gnu.so +0 -0
  49. a_sync/primitives/_debug.c +5729 -4823
  50. a_sync/primitives/_debug.cpython-38-i386-linux-gnu.so +0 -0
  51. a_sync/primitives/_loggable.c +4418 -3448
  52. a_sync/primitives/_loggable.cpython-38-i386-linux-gnu.so +0 -0
  53. a_sync/primitives/locks/counter.c +6517 -6130
  54. a_sync/primitives/locks/counter.cpython-38-i386-linux-gnu.so +0 -0
  55. a_sync/primitives/locks/event.c +6465 -5579
  56. a_sync/primitives/locks/event.cpython-38-i386-linux-gnu.so +0 -0
  57. a_sync/primitives/locks/prio_semaphore.c +9077 -8516
  58. a_sync/primitives/locks/prio_semaphore.cpython-38-i386-linux-gnu.so +0 -0
  59. a_sync/primitives/locks/semaphore.c +8645 -7949
  60. a_sync/primitives/locks/semaphore.cpython-38-i386-linux-gnu.so +0 -0
  61. a_sync/utils/repr.c +5929 -4759
  62. a_sync/utils/repr.cpython-38-i386-linux-gnu.so +0 -0
  63. {ez_a_sync-0.32.25.dist-info → ez_a_sync-0.32.27.dist-info}/METADATA +2 -2
  64. {ez_a_sync-0.32.25.dist-info → ez_a_sync-0.32.27.dist-info}/RECORD +67 -67
  65. {ez_a_sync-0.32.25.dist-info → ez_a_sync-0.32.27.dist-info}/LICENSE.txt +0 -0
  66. {ez_a_sync-0.32.25.dist-info → ez_a_sync-0.32.27.dist-info}/WHEEL +0 -0
  67. {ez_a_sync-0.32.25.dist-info → ez_a_sync-0.32.27.dist-info}/top_level.txt +0 -0
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
  """