PyEventEngine 0.6.2__cp315-cp315t-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.
Files changed (56) hide show
  1. event_engine/__infra__.pxd +2 -0
  2. event_engine/__init__.pxd +2 -0
  3. event_engine/__init__.py +62 -0
  4. event_engine/base/__infra__.pxd +9 -0
  5. event_engine/base/__init__.pxd +9 -0
  6. event_engine/base/__init__.py +31 -0
  7. event_engine/base/c_allocator_protocol.c +14310 -0
  8. event_engine/base/c_allocator_protocol.cp315t-win_amd64.pyd +0 -0
  9. event_engine/base/c_allocator_protocol.h +23 -0
  10. event_engine/base/c_allocator_protocol.pxd +31 -0
  11. event_engine/base/c_allocator_protocol.pyx +193 -0
  12. event_engine/capi/__infra__.pxd +189 -0
  13. event_engine/capi/__init__.pxd +189 -0
  14. event_engine/capi/__init__.py +84 -0
  15. event_engine/capi/c_engine.c +32542 -0
  16. event_engine/capi/c_engine.cp315t-win_amd64.pyd +0 -0
  17. event_engine/capi/c_engine.h +393 -0
  18. event_engine/capi/c_engine.pxd +84 -0
  19. event_engine/capi/c_engine.pyi +478 -0
  20. event_engine/capi/c_engine.pyx +673 -0
  21. event_engine/capi/c_event.c +22826 -0
  22. event_engine/capi/c_event.cp315t-win_amd64.pyd +0 -0
  23. event_engine/capi/c_event.h +342 -0
  24. event_engine/capi/c_event.pxd +159 -0
  25. event_engine/capi/c_event.pyi +265 -0
  26. event_engine/capi/c_event.pyx +444 -0
  27. event_engine/capi/c_topic.c +34545 -0
  28. event_engine/capi/c_topic.cp315t-win_amd64.pyd +0 -0
  29. event_engine/capi/c_topic.h +1007 -0
  30. event_engine/capi/c_topic.pxd +147 -0
  31. event_engine/capi/c_topic.pyi +644 -0
  32. event_engine/capi/c_topic.pyx +818 -0
  33. event_engine/capi/fallback_engine.py +707 -0
  34. event_engine/config_view.c +10271 -0
  35. event_engine/config_view.cp315t-win_amd64.pyd +0 -0
  36. event_engine/config_view.pyx +55 -0
  37. event_engine/includes/event_engine/base/c_allocator_protocol.c +14310 -0
  38. event_engine/includes/event_engine/base/c_allocator_protocol.h +23 -0
  39. event_engine/includes/event_engine/capi/c_engine.c +32542 -0
  40. event_engine/includes/event_engine/capi/c_engine.h +393 -0
  41. event_engine/includes/event_engine/capi/c_event.c +22826 -0
  42. event_engine/includes/event_engine/capi/c_event.h +342 -0
  43. event_engine/includes/event_engine/capi/c_topic.c +34545 -0
  44. event_engine/includes/event_engine/capi/c_topic.h +1007 -0
  45. event_engine/includes/event_engine/config_view.c +10271 -0
  46. event_engine/native/__init__.py +60 -0
  47. event_engine/native/_event.py +420 -0
  48. event_engine/native/_topic.py +171 -0
  49. event_engine/native/engine.py +793 -0
  50. event_engine/native/event.py +469 -0
  51. event_engine/native/topic.py +943 -0
  52. pyeventengine-0.6.2.dist-info/METADATA +189 -0
  53. pyeventengine-0.6.2.dist-info/RECORD +56 -0
  54. pyeventengine-0.6.2.dist-info/WHEEL +5 -0
  55. pyeventengine-0.6.2.dist-info/licenses/LICENSE +21 -0
  56. pyeventengine-0.6.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,84 @@
1
+ import logging
2
+
3
+ LOGGER = None
4
+
5
+
6
+ from .c_topic import (
7
+ TopicType,
8
+ TopicPart, TopicPartExact, TopicPartAny, TopicPartRange, TopicPartPattern,
9
+ TopicMatchResult, Topic,
10
+ get_internal_topic, get_internal_map
11
+ )
12
+
13
+ from .c_event import MessagePayload, EventHook, EventHookEx
14
+
15
+ # Try to import the Cython implementation first, fall back to pure Python if unavailable
16
+ USING_FALLBACK = False
17
+
18
+ try:
19
+ assert not USING_FALLBACK
20
+ from .c_engine import Full, Empty, EventEngine, EventEngineEx
21
+
22
+ USING_FALLBACK = False
23
+ except (ImportError, AssertionError) as e:
24
+ # Cython module not available (e.g., on Windows or not compiled)
25
+ # Use the pure Python fallback implementation
26
+ import warnings
27
+
28
+ warnings.warn(
29
+ f"Cython c_engine module not available ({e}), using pure Python fallback implementation. "
30
+ "Performance may be reduced compared to the Cython version.",
31
+ ImportWarning,
32
+ stacklevel=2
33
+ )
34
+ from .fallback_engine import Full, Empty, EventEngine, EventEngineEx
35
+
36
+ USING_FALLBACK = True
37
+
38
+
39
+ def set_logger(logger: logging.Logger):
40
+ global LOGGER
41
+ from . import c_topic, c_event, c_engine
42
+ c_topic.LOGGER = logger
43
+ c_event.LOGGER = logger
44
+ c_engine.LOGGER = logger
45
+ LOGGER = logger
46
+
47
+ """Set the root EventEngine logger and propagate to submodules.
48
+
49
+ This updates event_engine.base.LOGGER and the module-level LOGGER used by
50
+ c_event/fallback_engine (if available) so subsequent logs use the provided logger.
51
+ """
52
+ import importlib
53
+ base_mod = importlib.import_module('event_engine.base')
54
+ base_mod.LOGGER = logger
55
+ # Try to update c_event module logger
56
+ try:
57
+ from . import c_event as _c_event
58
+ _c_event.LOGGER = logger.getChild('Event')
59
+ except Exception:
60
+ pass
61
+
62
+ # Try to update c_engine module logger
63
+ try:
64
+ from . import c_engine as _c_engine
65
+ _c_engine.LOGGER = logger.getChild('Engine')
66
+ except Exception:
67
+ pass
68
+
69
+ # If capi is using fallback engine internally, update its module logger as well
70
+ try:
71
+ from . import fallback_engine as _c_engine_fallback
72
+ _c_engine_fallback.LOGGER = logger.getChild('Engine')
73
+ except Exception:
74
+ pass
75
+
76
+
77
+ __all__ = [
78
+ 'TopicType', 'TopicPart', 'TopicPartExact', 'TopicPartAny', 'TopicPartRange', 'TopicPartPattern',
79
+ 'TopicMatchResult', 'Topic',
80
+ 'get_internal_topic', 'get_internal_map',
81
+ 'MessagePayload', 'EventHook', 'EventHookEx',
82
+ 'Full', 'Empty', 'EventEngine', 'EventEngineEx', 'USING_FALLBACK',
83
+ 'set_logger'
84
+ ]