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.
- event_engine/__infra__.pxd +2 -0
- event_engine/__init__.pxd +2 -0
- event_engine/__init__.py +62 -0
- event_engine/base/__infra__.pxd +9 -0
- event_engine/base/__init__.pxd +9 -0
- event_engine/base/__init__.py +31 -0
- event_engine/base/c_allocator_protocol.c +14310 -0
- event_engine/base/c_allocator_protocol.cp315t-win_amd64.pyd +0 -0
- event_engine/base/c_allocator_protocol.h +23 -0
- event_engine/base/c_allocator_protocol.pxd +31 -0
- event_engine/base/c_allocator_protocol.pyx +193 -0
- event_engine/capi/__infra__.pxd +189 -0
- event_engine/capi/__init__.pxd +189 -0
- event_engine/capi/__init__.py +84 -0
- event_engine/capi/c_engine.c +32542 -0
- event_engine/capi/c_engine.cp315t-win_amd64.pyd +0 -0
- event_engine/capi/c_engine.h +393 -0
- event_engine/capi/c_engine.pxd +84 -0
- event_engine/capi/c_engine.pyi +478 -0
- event_engine/capi/c_engine.pyx +673 -0
- event_engine/capi/c_event.c +22826 -0
- event_engine/capi/c_event.cp315t-win_amd64.pyd +0 -0
- event_engine/capi/c_event.h +342 -0
- event_engine/capi/c_event.pxd +159 -0
- event_engine/capi/c_event.pyi +265 -0
- event_engine/capi/c_event.pyx +444 -0
- event_engine/capi/c_topic.c +34545 -0
- event_engine/capi/c_topic.cp315t-win_amd64.pyd +0 -0
- event_engine/capi/c_topic.h +1007 -0
- event_engine/capi/c_topic.pxd +147 -0
- event_engine/capi/c_topic.pyi +644 -0
- event_engine/capi/c_topic.pyx +818 -0
- event_engine/capi/fallback_engine.py +707 -0
- event_engine/config_view.c +10271 -0
- event_engine/config_view.cp315t-win_amd64.pyd +0 -0
- event_engine/config_view.pyx +55 -0
- event_engine/includes/event_engine/base/c_allocator_protocol.c +14310 -0
- event_engine/includes/event_engine/base/c_allocator_protocol.h +23 -0
- event_engine/includes/event_engine/capi/c_engine.c +32542 -0
- event_engine/includes/event_engine/capi/c_engine.h +393 -0
- event_engine/includes/event_engine/capi/c_event.c +22826 -0
- event_engine/includes/event_engine/capi/c_event.h +342 -0
- event_engine/includes/event_engine/capi/c_topic.c +34545 -0
- event_engine/includes/event_engine/capi/c_topic.h +1007 -0
- event_engine/includes/event_engine/config_view.c +10271 -0
- event_engine/native/__init__.py +60 -0
- event_engine/native/_event.py +420 -0
- event_engine/native/_topic.py +171 -0
- event_engine/native/engine.py +793 -0
- event_engine/native/event.py +469 -0
- event_engine/native/topic.py +943 -0
- pyeventengine-0.6.2.dist-info/METADATA +189 -0
- pyeventengine-0.6.2.dist-info/RECORD +56 -0
- pyeventengine-0.6.2.dist-info/WHEEL +5 -0
- pyeventengine-0.6.2.dist-info/licenses/LICENSE +21 -0
- pyeventengine-0.6.2.dist-info/top_level.txt +1 -0
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#ifndef C_EVENT_ENGINE_ALLOCATOR_PROTOCOL_H
|
|
2
|
+
#define C_EVENT_ENGINE_ALLOCATOR_PROTOCOL_H
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @brief EventEngine-local allocator protocol header.
|
|
6
|
+
*
|
|
7
|
+
* Wraps PyCyBase's allocator_protocol with an EE_LOCAL_ONLY compile-time
|
|
8
|
+
* switch. When EE_LOCAL_ONLY is 1 (default, thread-local engine), only the
|
|
9
|
+
* heap-allocator branch is available and SHM is excluded. Set to 0 to
|
|
10
|
+
* enable the full shared-memory allocator stack.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef EE_LOCAL_ONLY
|
|
14
|
+
#define EE_LOCAL_ONLY 1
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#include <cbase/allocator_protocol/c_allocator_protocol.h>
|
|
18
|
+
|
|
19
|
+
#if !EE_LOCAL_ONLY
|
|
20
|
+
#include <cbase/allocator_protocol/c_shm_comp.h>
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
#endif /* C_EVENT_ENGINE_ALLOCATOR_PROTOCOL_H */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from libcpp cimport bool as c_bool
|
|
2
|
+
|
|
3
|
+
from cbase.allocator_protocol.c_allocator_protocol cimport AllocatorConfigContext, allocator_protocol
|
|
4
|
+
from cbase.allocator_protocol.c_heap_allocator cimport heap_allocator
|
|
5
|
+
from cbase.allocator_protocol.c_shm_comp cimport shm_allocator_ctx
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
cdef extern from "event_engine/base/c_allocator_protocol.h":
|
|
9
|
+
const c_bool EE_LOCAL_ONLY
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
cdef c_bool EE_CFG_LOCKED
|
|
13
|
+
cdef c_bool EE_CFG_SHARED
|
|
14
|
+
cdef c_bool EE_CFG_FREELIST
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
cdef class EEConfigContext(AllocatorConfigContext):
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
cdef heap_allocator* EE_HEAP_ALLOCATOR_RAW
|
|
22
|
+
cdef shm_allocator_ctx* EE_SHM_ALLOCATOR_RAW
|
|
23
|
+
|
|
24
|
+
cdef allocator_protocol* EE_DEFAULT_ALLOCATOR
|
|
25
|
+
cdef allocator_protocol* EE_SHM_ALLOCATOR
|
|
26
|
+
cdef allocator_protocol* EE_HEAP_ALLOCATOR
|
|
27
|
+
|
|
28
|
+
cdef EEConfigContext EE_SHARED
|
|
29
|
+
cdef EEConfigContext EE_LOCKED
|
|
30
|
+
cdef EEConfigContext EE_LOCKFREE
|
|
31
|
+
cdef EEConfigContext EE_FREELIST
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
from libc.stdlib cimport calloc
|
|
2
|
+
from libcpp cimport bool as c_bool
|
|
3
|
+
|
|
4
|
+
from cbase.allocator_protocol.c_heap_allocator cimport c_heap_allocator_new
|
|
5
|
+
from cbase.allocator_protocol.c_shm_comp cimport c_shm_allocator_new, AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
cdef c_bool EE_CFG_LOCKED = False
|
|
9
|
+
cdef c_bool EE_CFG_SHARED = False
|
|
10
|
+
cdef c_bool EE_CFG_FREELIST = True
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
cdef class EEConfigContext(AllocatorConfigContext):
|
|
14
|
+
cdef void c_bind(self, allocator_protocol* schematic=NULL):
|
|
15
|
+
self.allocator_schematic = schematic if schematic else EE_DEFAULT_ALLOCATOR
|
|
16
|
+
|
|
17
|
+
cdef void c_activate(self):
|
|
18
|
+
if 'locked' in self.overrides:
|
|
19
|
+
global EE_CFG_LOCKED
|
|
20
|
+
EE_CFG_LOCKED = self.overrides['locked']
|
|
21
|
+
|
|
22
|
+
if 'shared' in self.overrides:
|
|
23
|
+
global EE_CFG_SHARED
|
|
24
|
+
EE_CFG_SHARED = self.overrides['shared']
|
|
25
|
+
|
|
26
|
+
if 'freelist' in self.overrides:
|
|
27
|
+
global EE_CFG_FREELIST
|
|
28
|
+
EE_CFG_FREELIST = self.overrides['freelist']
|
|
29
|
+
|
|
30
|
+
AllocatorConfigContext.c_activate(self)
|
|
31
|
+
|
|
32
|
+
cdef void c_deactivate(self):
|
|
33
|
+
if 'locked' in self.originals:
|
|
34
|
+
global EE_CFG_LOCKED
|
|
35
|
+
EE_CFG_LOCKED = self.originals.get('locked')
|
|
36
|
+
|
|
37
|
+
if 'shared' in self.originals:
|
|
38
|
+
global EE_CFG_SHARED
|
|
39
|
+
EE_CFG_SHARED = self.originals.get('shared')
|
|
40
|
+
|
|
41
|
+
if 'freelist' in self.originals:
|
|
42
|
+
global EE_CFG_FREELIST
|
|
43
|
+
EE_CFG_FREELIST = self.originals.get('freelist')
|
|
44
|
+
|
|
45
|
+
AllocatorConfigContext.c_deactivate(self)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# --- Module-level allocator singletons ---
|
|
49
|
+
|
|
50
|
+
cdef heap_allocator* EE_HEAP_ALLOCATOR_RAW = c_heap_allocator_new()
|
|
51
|
+
if not EE_HEAP_ALLOCATOR_RAW:
|
|
52
|
+
raise OSError("Initialize EE heap allocator failed")
|
|
53
|
+
|
|
54
|
+
cdef shm_allocator_ctx* EE_SHM_ALLOCATOR_RAW = NULL
|
|
55
|
+
|
|
56
|
+
if not EE_LOCAL_ONLY:
|
|
57
|
+
EE_SHM_ALLOCATOR_RAW = c_shm_allocator_new(AP_SHM_ALLOCATOR_DEFAULT_REGION_SIZE, <char*> b"c_ee_shm")
|
|
58
|
+
if not EE_SHM_ALLOCATOR_RAW:
|
|
59
|
+
raise OSError("Initialize EE SHM allocator failed (prefix='c_ee_shm')")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
cdef allocator_protocol* EE_DEFAULT_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
63
|
+
cdef allocator_protocol* EE_HEAP_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
64
|
+
|
|
65
|
+
EE_DEFAULT_ALLOCATOR.with_lock = EE_CFG_LOCKED
|
|
66
|
+
EE_DEFAULT_ALLOCATOR.with_shm = EE_CFG_SHARED
|
|
67
|
+
EE_DEFAULT_ALLOCATOR.with_freelist = EE_CFG_FREELIST
|
|
68
|
+
EE_DEFAULT_ALLOCATOR.shm_allocator_ctx = EE_SHM_ALLOCATOR_RAW
|
|
69
|
+
EE_DEFAULT_ALLOCATOR.shm_allocator = EE_SHM_ALLOCATOR_RAW.shm_allocator if EE_SHM_ALLOCATOR_RAW != NULL else NULL
|
|
70
|
+
EE_DEFAULT_ALLOCATOR.heap_allocator = EE_HEAP_ALLOCATOR_RAW
|
|
71
|
+
|
|
72
|
+
EE_HEAP_ALLOCATOR.with_lock = True
|
|
73
|
+
EE_HEAP_ALLOCATOR.with_shm = False
|
|
74
|
+
EE_HEAP_ALLOCATOR.with_freelist = True
|
|
75
|
+
EE_HEAP_ALLOCATOR.shm_allocator_ctx = NULL
|
|
76
|
+
EE_HEAP_ALLOCATOR.shm_allocator = NULL
|
|
77
|
+
EE_HEAP_ALLOCATOR.heap_allocator = EE_HEAP_ALLOCATOR_RAW
|
|
78
|
+
|
|
79
|
+
cdef allocator_protocol* EE_SHM_ALLOCATOR = NULL
|
|
80
|
+
|
|
81
|
+
if not EE_LOCAL_ONLY:
|
|
82
|
+
EE_SHM_ALLOCATOR = <allocator_protocol*> calloc(1, sizeof(allocator_protocol))
|
|
83
|
+
|
|
84
|
+
EE_SHM_ALLOCATOR.with_lock = True
|
|
85
|
+
EE_SHM_ALLOCATOR.with_shm = True
|
|
86
|
+
EE_SHM_ALLOCATOR.with_freelist = True
|
|
87
|
+
EE_SHM_ALLOCATOR.shm_allocator_ctx = EE_SHM_ALLOCATOR_RAW
|
|
88
|
+
EE_SHM_ALLOCATOR.shm_allocator = EE_SHM_ALLOCATOR_RAW.shm_allocator
|
|
89
|
+
EE_SHM_ALLOCATOR.heap_allocator = NULL
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
cdef EEConfigContext EE_SHARED = EEConfigContext(shared=True)
|
|
93
|
+
cdef EEConfigContext EE_LOCKED = EEConfigContext(locked=True)
|
|
94
|
+
cdef EEConfigContext EE_LOCKFREE = EEConfigContext(locked=False)
|
|
95
|
+
cdef EEConfigContext EE_FREELIST = EEConfigContext(freelist=True)
|
|
96
|
+
|
|
97
|
+
globals()['EE_SHARED'] = EE_SHARED
|
|
98
|
+
globals()['EE_LOCKED'] = EE_LOCKED
|
|
99
|
+
globals()['EE_LOCKFREE'] = EE_LOCKFREE
|
|
100
|
+
globals()['EE_FREELIST'] = EE_FREELIST
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# -- Runtime config accessor (reads live cdef globals) --------------------
|
|
104
|
+
class _RuntimeAllocatorConfig:
|
|
105
|
+
"""Property-based accessor for live EE_CFG_* globals.
|
|
106
|
+
|
|
107
|
+
Unlike the compile-time CONFIG_VIEW mappingproxy, these properties read
|
|
108
|
+
the CURRENT value, which may change when an EEConfigContext is active.
|
|
109
|
+
"""
|
|
110
|
+
@property
|
|
111
|
+
def EE_CFG_LOCKED(self):
|
|
112
|
+
return EE_CFG_LOCKED
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def EE_CFG_SHARED(self):
|
|
116
|
+
return EE_CFG_SHARED
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def EE_CFG_FREELIST(self):
|
|
120
|
+
return EE_CFG_FREELIST
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
RUNTIME_ALLOCATOR_CONFIG = _RuntimeAllocatorConfig()
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
cdef class AllocatorTestToolkit:
|
|
127
|
+
"""Relays internal allocator-protocol state to Python for test validation.
|
|
128
|
+
|
|
129
|
+
Exposes the live ``EE_CFG_*`` globals, the allocator protocol struct
|
|
130
|
+
configurations (lock/shm/freelist flags and backing allocator presence),
|
|
131
|
+
and the ``EEConfigContext`` activation path — all of which are internal
|
|
132
|
+
C state that the public Python API does not otherwise expose.
|
|
133
|
+
|
|
134
|
+
Note:
|
|
135
|
+
Test-only class. Not declared in any ``.pxd``; not part of the
|
|
136
|
+
public package API.
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
@staticmethod
|
|
140
|
+
def get_cfg_locked() -> c_bool:
|
|
141
|
+
"""Live value of the EE_CFG_LOCKED global."""
|
|
142
|
+
return EE_CFG_LOCKED
|
|
143
|
+
|
|
144
|
+
@staticmethod
|
|
145
|
+
def get_cfg_shared() -> c_bool:
|
|
146
|
+
"""Live value of the EE_CFG_SHARED global."""
|
|
147
|
+
return EE_CFG_SHARED
|
|
148
|
+
|
|
149
|
+
@staticmethod
|
|
150
|
+
def get_cfg_freelist() -> c_bool:
|
|
151
|
+
"""Live value of the EE_CFG_FREELIST global."""
|
|
152
|
+
return EE_CFG_FREELIST
|
|
153
|
+
|
|
154
|
+
@staticmethod
|
|
155
|
+
def get_default_allocator_config() -> dict:
|
|
156
|
+
"""Flag/backing configuration of the EE_DEFAULT_ALLOCATOR protocol."""
|
|
157
|
+
if EE_DEFAULT_ALLOCATOR == NULL:
|
|
158
|
+
return None
|
|
159
|
+
return {
|
|
160
|
+
'with_lock': EE_DEFAULT_ALLOCATOR.with_lock,
|
|
161
|
+
'with_shm': EE_DEFAULT_ALLOCATOR.with_shm,
|
|
162
|
+
'with_freelist': EE_DEFAULT_ALLOCATOR.with_freelist,
|
|
163
|
+
'has_heap': EE_DEFAULT_ALLOCATOR.heap_allocator != NULL,
|
|
164
|
+
'has_shm': EE_DEFAULT_ALLOCATOR.shm_allocator != NULL,
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@staticmethod
|
|
168
|
+
def get_heap_allocator_config() -> dict:
|
|
169
|
+
"""Flag/backing configuration of the EE_HEAP_ALLOCATOR protocol."""
|
|
170
|
+
if EE_HEAP_ALLOCATOR == NULL:
|
|
171
|
+
return None
|
|
172
|
+
return {
|
|
173
|
+
'with_lock': EE_HEAP_ALLOCATOR.with_lock,
|
|
174
|
+
'with_shm': EE_HEAP_ALLOCATOR.with_shm,
|
|
175
|
+
'with_freelist': EE_HEAP_ALLOCATOR.with_freelist,
|
|
176
|
+
'has_heap': EE_HEAP_ALLOCATOR.heap_allocator != NULL,
|
|
177
|
+
'has_shm': EE_HEAP_ALLOCATOR.shm_allocator != NULL,
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@staticmethod
|
|
181
|
+
def is_shm_available() -> bint:
|
|
182
|
+
"""Whether the shared-memory allocator protocol is configured."""
|
|
183
|
+
return EE_SHM_ALLOCATOR != NULL
|
|
184
|
+
|
|
185
|
+
@staticmethod
|
|
186
|
+
def activate_context(EEConfigContext ctx) -> None:
|
|
187
|
+
"""Activate an EEConfigContext (relay of the cdef c_activate)."""
|
|
188
|
+
ctx.c_activate()
|
|
189
|
+
|
|
190
|
+
@staticmethod
|
|
191
|
+
def deactivate_context(EEConfigContext ctx) -> None:
|
|
192
|
+
"""Deactivate an EEConfigContext (relay of the cdef c_deactivate)."""
|
|
193
|
+
ctx.c_deactivate()
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from .c_topic cimport (
|
|
2
|
+
DEFAULT_TOPIC_SEP,
|
|
3
|
+
DEFAULT_OPTION_SEP,
|
|
4
|
+
DEFAULT_RANGE_BRACKETS,
|
|
5
|
+
DEFAULT_WILDCARD_BRACKETS,
|
|
6
|
+
DEFAULT_WILDCARD_MARKER,
|
|
7
|
+
DEFAULT_PATTERN_DELIM,
|
|
8
|
+
GLOBAL_INTERNAL_MAP,
|
|
9
|
+
|
|
10
|
+
c_get_global_internal_map,
|
|
11
|
+
c_topic_new,
|
|
12
|
+
c_topic_free,
|
|
13
|
+
c_topic_internalize,
|
|
14
|
+
c_topic_append,
|
|
15
|
+
c_topic_parse,
|
|
16
|
+
c_topic_assign,
|
|
17
|
+
c_topic_update_literal,
|
|
18
|
+
c_topic_match,
|
|
19
|
+
c_topic_match_new,
|
|
20
|
+
c_topic_match_free,
|
|
21
|
+
c_topic_match_bool,
|
|
22
|
+
|
|
23
|
+
evt_topic_type, evt_topic_part,
|
|
24
|
+
TopicPartExact, evt_topic_exact,
|
|
25
|
+
TopicPartAny, evt_topic_any,
|
|
26
|
+
TopicPartRange, evt_topic_range,
|
|
27
|
+
TopicPartPattern, evt_topic_pattern,
|
|
28
|
+
TopicPart, evt_topic_part_variant,
|
|
29
|
+
TopicMatchResult, evt_topic_match,
|
|
30
|
+
Topic, evt_topic,
|
|
31
|
+
|
|
32
|
+
TOPIC_ALLOCATOR,
|
|
33
|
+
get_internal_topic,
|
|
34
|
+
get_internal_map,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
from .c_event cimport (
|
|
38
|
+
evt_py_payload, evt_message_payload, MessagePayload,
|
|
39
|
+
c_evt_payload_new,
|
|
40
|
+
c_evt_payload_free,
|
|
41
|
+
|
|
42
|
+
evt_callback_bare,
|
|
43
|
+
evt_callback_with_args,
|
|
44
|
+
evt_callback_with_topic,
|
|
45
|
+
evt_callback_with_userdata,
|
|
46
|
+
evt_callback_with_args_topic,
|
|
47
|
+
evt_callback_with_args_userdata,
|
|
48
|
+
evt_callback_with_topic_userdata,
|
|
49
|
+
evt_callback_with_args_topic_userdata,
|
|
50
|
+
evt_callback_with_payload,
|
|
51
|
+
evt_callback_with_payload_userdata,
|
|
52
|
+
|
|
53
|
+
evt_callback_type,
|
|
54
|
+
evt_callback_variants,
|
|
55
|
+
evt_callback,
|
|
56
|
+
evt_py_callable,
|
|
57
|
+
|
|
58
|
+
evt_hook_watcher_type,
|
|
59
|
+
evt_hook_watcher_fn,
|
|
60
|
+
evt_hook_watcher,
|
|
61
|
+
evt_hook_stats, c_hook_enter, c_hook_exit,
|
|
62
|
+
|
|
63
|
+
evt_hook, EventHook, EventHookEx,
|
|
64
|
+
|
|
65
|
+
c_evt_callback_invoke,
|
|
66
|
+
c_evt_hook_new,
|
|
67
|
+
c_evt_hook_free,
|
|
68
|
+
c_evt_hook_add_watcher,
|
|
69
|
+
c_evt_hook_register_callback,
|
|
70
|
+
c_evt_hook_pop_callback,
|
|
71
|
+
c_evt_hook_invoke,
|
|
72
|
+
evt_hook_ret_code,
|
|
73
|
+
|
|
74
|
+
EMPTY_ARGS, TOPIC_FIELD_NAME
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
from .c_engine cimport (
|
|
78
|
+
DEFAULT_MQ_CAPACITY,
|
|
79
|
+
DEFAULT_MQ_SPIN_LIMIT,
|
|
80
|
+
DEFAULT_MQ_TIMEOUT_SECONDS,
|
|
81
|
+
message_queue,
|
|
82
|
+
|
|
83
|
+
c_mq_new,
|
|
84
|
+
c_mq_free,
|
|
85
|
+
c_mq_put,
|
|
86
|
+
c_mq_get,
|
|
87
|
+
c_mq_put_await,
|
|
88
|
+
c_mq_get_await,
|
|
89
|
+
c_mq_put_busy,
|
|
90
|
+
c_mq_get_busy,
|
|
91
|
+
c_mq_put_hybrid,
|
|
92
|
+
c_mq_get_hybrid,
|
|
93
|
+
c_mq_occupied,
|
|
94
|
+
|
|
95
|
+
EventEngine, EventEngineEx
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
__all__ = [
|
|
99
|
+
'DEFAULT_TOPIC_SEP',
|
|
100
|
+
'DEFAULT_OPTION_SEP',
|
|
101
|
+
'DEFAULT_RANGE_BRACKETS',
|
|
102
|
+
'DEFAULT_WILDCARD_BRACKETS',
|
|
103
|
+
'DEFAULT_WILDCARD_MARKER',
|
|
104
|
+
'DEFAULT_PATTERN_DELIM',
|
|
105
|
+
'GLOBAL_INTERNAL_MAP',
|
|
106
|
+
|
|
107
|
+
'c_get_global_internal_map',
|
|
108
|
+
'c_topic_new',
|
|
109
|
+
'c_topic_free',
|
|
110
|
+
'c_topic_internalize',
|
|
111
|
+
'c_topic_append',
|
|
112
|
+
'c_topic_parse',
|
|
113
|
+
'c_topic_assign',
|
|
114
|
+
'c_topic_update_literal',
|
|
115
|
+
'c_topic_match',
|
|
116
|
+
'c_topic_match_new',
|
|
117
|
+
'c_topic_match_free',
|
|
118
|
+
'c_topic_match_bool',
|
|
119
|
+
|
|
120
|
+
'evt_topic_type', 'evt_topic_part',
|
|
121
|
+
'TopicPartExact', 'evt_topic_exact',
|
|
122
|
+
'TopicPartAny', 'evt_topic_any',
|
|
123
|
+
'TopicPartRange', 'evt_topic_range',
|
|
124
|
+
'TopicPartPattern', 'evt_topic_pattern',
|
|
125
|
+
'TopicPart', 'evt_topic_part_variant',
|
|
126
|
+
'TopicMatchResult', 'evt_topic_match',
|
|
127
|
+
'Topic', 'evt_topic',
|
|
128
|
+
|
|
129
|
+
'TOPIC_ALLOCATOR',
|
|
130
|
+
'get_internal_topic',
|
|
131
|
+
'get_internal_map',
|
|
132
|
+
|
|
133
|
+
'evt_py_payload', 'evt_message_payload', 'MessagePayload',
|
|
134
|
+
'c_evt_payload_new',
|
|
135
|
+
'c_evt_payload_free',
|
|
136
|
+
|
|
137
|
+
'evt_callback_bare',
|
|
138
|
+
'evt_callback_with_args',
|
|
139
|
+
'evt_callback_with_topic',
|
|
140
|
+
'evt_callback_with_userdata',
|
|
141
|
+
'evt_callback_with_args_topic',
|
|
142
|
+
'evt_callback_with_args_userdata',
|
|
143
|
+
'evt_callback_with_topic_userdata',
|
|
144
|
+
'evt_callback_with_args_topic_userdata',
|
|
145
|
+
'evt_callback_with_payload',
|
|
146
|
+
'evt_callback_with_payload_userdata',
|
|
147
|
+
|
|
148
|
+
'evt_callback_type',
|
|
149
|
+
'evt_callback_variants',
|
|
150
|
+
'evt_callback',
|
|
151
|
+
'evt_py_callable',
|
|
152
|
+
|
|
153
|
+
'evt_hook_watcher_type',
|
|
154
|
+
'evt_hook_watcher_fn',
|
|
155
|
+
'evt_hook_watcher',
|
|
156
|
+
'evt_hook_stats', 'c_hook_enter', 'c_hook_exit',
|
|
157
|
+
|
|
158
|
+
'evt_hook', 'EventHook', 'EventHookEx',
|
|
159
|
+
|
|
160
|
+
'c_evt_callback_invoke',
|
|
161
|
+
'c_evt_hook_new',
|
|
162
|
+
'c_evt_hook_free',
|
|
163
|
+
'c_evt_hook_add_watcher',
|
|
164
|
+
'c_evt_hook_register_callback',
|
|
165
|
+
'c_evt_hook_pop_callback',
|
|
166
|
+
'c_evt_hook_invoke',
|
|
167
|
+
'evt_hook_ret_code',
|
|
168
|
+
|
|
169
|
+
'EMPTY_ARGS', 'TOPIC_FIELD_NAME',
|
|
170
|
+
|
|
171
|
+
'DEFAULT_MQ_CAPACITY',
|
|
172
|
+
'DEFAULT_MQ_SPIN_LIMIT',
|
|
173
|
+
'DEFAULT_MQ_TIMEOUT_SECONDS',
|
|
174
|
+
'message_queue',
|
|
175
|
+
|
|
176
|
+
'c_mq_new',
|
|
177
|
+
'c_mq_free',
|
|
178
|
+
'c_mq_put',
|
|
179
|
+
'c_mq_get',
|
|
180
|
+
'c_mq_put_await',
|
|
181
|
+
'c_mq_get_await',
|
|
182
|
+
'c_mq_put_busy',
|
|
183
|
+
'c_mq_get_busy',
|
|
184
|
+
'c_mq_put_hybrid',
|
|
185
|
+
'c_mq_get_hybrid',
|
|
186
|
+
'c_mq_occupied',
|
|
187
|
+
|
|
188
|
+
'EventEngine', 'EventEngineEx'
|
|
189
|
+
]
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from .c_topic cimport (
|
|
2
|
+
DEFAULT_TOPIC_SEP,
|
|
3
|
+
DEFAULT_OPTION_SEP,
|
|
4
|
+
DEFAULT_RANGE_BRACKETS,
|
|
5
|
+
DEFAULT_WILDCARD_BRACKETS,
|
|
6
|
+
DEFAULT_WILDCARD_MARKER,
|
|
7
|
+
DEFAULT_PATTERN_DELIM,
|
|
8
|
+
GLOBAL_INTERNAL_MAP,
|
|
9
|
+
|
|
10
|
+
c_get_global_internal_map,
|
|
11
|
+
c_topic_new,
|
|
12
|
+
c_topic_free,
|
|
13
|
+
c_topic_internalize,
|
|
14
|
+
c_topic_append,
|
|
15
|
+
c_topic_parse,
|
|
16
|
+
c_topic_assign,
|
|
17
|
+
c_topic_update_literal,
|
|
18
|
+
c_topic_match,
|
|
19
|
+
c_topic_match_new,
|
|
20
|
+
c_topic_match_free,
|
|
21
|
+
c_topic_match_bool,
|
|
22
|
+
|
|
23
|
+
evt_topic_type, evt_topic_part,
|
|
24
|
+
TopicPartExact, evt_topic_exact,
|
|
25
|
+
TopicPartAny, evt_topic_any,
|
|
26
|
+
TopicPartRange, evt_topic_range,
|
|
27
|
+
TopicPartPattern, evt_topic_pattern,
|
|
28
|
+
TopicPart, evt_topic_part_variant,
|
|
29
|
+
TopicMatchResult, evt_topic_match,
|
|
30
|
+
Topic, evt_topic,
|
|
31
|
+
|
|
32
|
+
TOPIC_ALLOCATOR,
|
|
33
|
+
get_internal_topic,
|
|
34
|
+
get_internal_map,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
from .c_event cimport (
|
|
38
|
+
evt_py_payload, evt_message_payload, MessagePayload,
|
|
39
|
+
c_evt_payload_new,
|
|
40
|
+
c_evt_payload_free,
|
|
41
|
+
|
|
42
|
+
evt_callback_bare,
|
|
43
|
+
evt_callback_with_args,
|
|
44
|
+
evt_callback_with_topic,
|
|
45
|
+
evt_callback_with_userdata,
|
|
46
|
+
evt_callback_with_args_topic,
|
|
47
|
+
evt_callback_with_args_userdata,
|
|
48
|
+
evt_callback_with_topic_userdata,
|
|
49
|
+
evt_callback_with_args_topic_userdata,
|
|
50
|
+
evt_callback_with_payload,
|
|
51
|
+
evt_callback_with_payload_userdata,
|
|
52
|
+
|
|
53
|
+
evt_callback_type,
|
|
54
|
+
evt_callback_variants,
|
|
55
|
+
evt_callback,
|
|
56
|
+
evt_py_callable,
|
|
57
|
+
|
|
58
|
+
evt_hook_watcher_type,
|
|
59
|
+
evt_hook_watcher_fn,
|
|
60
|
+
evt_hook_watcher,
|
|
61
|
+
evt_hook_stats, c_hook_enter, c_hook_exit,
|
|
62
|
+
|
|
63
|
+
evt_hook, EventHook, EventHookEx,
|
|
64
|
+
|
|
65
|
+
c_evt_callback_invoke,
|
|
66
|
+
c_evt_hook_new,
|
|
67
|
+
c_evt_hook_free,
|
|
68
|
+
c_evt_hook_add_watcher,
|
|
69
|
+
c_evt_hook_register_callback,
|
|
70
|
+
c_evt_hook_pop_callback,
|
|
71
|
+
c_evt_hook_invoke,
|
|
72
|
+
evt_hook_ret_code,
|
|
73
|
+
|
|
74
|
+
EMPTY_ARGS, TOPIC_FIELD_NAME
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
from .c_engine cimport (
|
|
78
|
+
DEFAULT_MQ_CAPACITY,
|
|
79
|
+
DEFAULT_MQ_SPIN_LIMIT,
|
|
80
|
+
DEFAULT_MQ_TIMEOUT_SECONDS,
|
|
81
|
+
message_queue,
|
|
82
|
+
|
|
83
|
+
c_mq_new,
|
|
84
|
+
c_mq_free,
|
|
85
|
+
c_mq_put,
|
|
86
|
+
c_mq_get,
|
|
87
|
+
c_mq_put_await,
|
|
88
|
+
c_mq_get_await,
|
|
89
|
+
c_mq_put_busy,
|
|
90
|
+
c_mq_get_busy,
|
|
91
|
+
c_mq_put_hybrid,
|
|
92
|
+
c_mq_get_hybrid,
|
|
93
|
+
c_mq_occupied,
|
|
94
|
+
|
|
95
|
+
EventEngine, EventEngineEx
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
__all__ = [
|
|
99
|
+
'DEFAULT_TOPIC_SEP',
|
|
100
|
+
'DEFAULT_OPTION_SEP',
|
|
101
|
+
'DEFAULT_RANGE_BRACKETS',
|
|
102
|
+
'DEFAULT_WILDCARD_BRACKETS',
|
|
103
|
+
'DEFAULT_WILDCARD_MARKER',
|
|
104
|
+
'DEFAULT_PATTERN_DELIM',
|
|
105
|
+
'GLOBAL_INTERNAL_MAP',
|
|
106
|
+
|
|
107
|
+
'c_get_global_internal_map',
|
|
108
|
+
'c_topic_new',
|
|
109
|
+
'c_topic_free',
|
|
110
|
+
'c_topic_internalize',
|
|
111
|
+
'c_topic_append',
|
|
112
|
+
'c_topic_parse',
|
|
113
|
+
'c_topic_assign',
|
|
114
|
+
'c_topic_update_literal',
|
|
115
|
+
'c_topic_match',
|
|
116
|
+
'c_topic_match_new',
|
|
117
|
+
'c_topic_match_free',
|
|
118
|
+
'c_topic_match_bool',
|
|
119
|
+
|
|
120
|
+
'evt_topic_type', 'evt_topic_part',
|
|
121
|
+
'TopicPartExact', 'evt_topic_exact',
|
|
122
|
+
'TopicPartAny', 'evt_topic_any',
|
|
123
|
+
'TopicPartRange', 'evt_topic_range',
|
|
124
|
+
'TopicPartPattern', 'evt_topic_pattern',
|
|
125
|
+
'TopicPart', 'evt_topic_part_variant',
|
|
126
|
+
'TopicMatchResult', 'evt_topic_match',
|
|
127
|
+
'Topic', 'evt_topic',
|
|
128
|
+
|
|
129
|
+
'TOPIC_ALLOCATOR',
|
|
130
|
+
'get_internal_topic',
|
|
131
|
+
'get_internal_map',
|
|
132
|
+
|
|
133
|
+
'evt_py_payload', 'evt_message_payload', 'MessagePayload',
|
|
134
|
+
'c_evt_payload_new',
|
|
135
|
+
'c_evt_payload_free',
|
|
136
|
+
|
|
137
|
+
'evt_callback_bare',
|
|
138
|
+
'evt_callback_with_args',
|
|
139
|
+
'evt_callback_with_topic',
|
|
140
|
+
'evt_callback_with_userdata',
|
|
141
|
+
'evt_callback_with_args_topic',
|
|
142
|
+
'evt_callback_with_args_userdata',
|
|
143
|
+
'evt_callback_with_topic_userdata',
|
|
144
|
+
'evt_callback_with_args_topic_userdata',
|
|
145
|
+
'evt_callback_with_payload',
|
|
146
|
+
'evt_callback_with_payload_userdata',
|
|
147
|
+
|
|
148
|
+
'evt_callback_type',
|
|
149
|
+
'evt_callback_variants',
|
|
150
|
+
'evt_callback',
|
|
151
|
+
'evt_py_callable',
|
|
152
|
+
|
|
153
|
+
'evt_hook_watcher_type',
|
|
154
|
+
'evt_hook_watcher_fn',
|
|
155
|
+
'evt_hook_watcher',
|
|
156
|
+
'evt_hook_stats', 'c_hook_enter', 'c_hook_exit',
|
|
157
|
+
|
|
158
|
+
'evt_hook', 'EventHook', 'EventHookEx',
|
|
159
|
+
|
|
160
|
+
'c_evt_callback_invoke',
|
|
161
|
+
'c_evt_hook_new',
|
|
162
|
+
'c_evt_hook_free',
|
|
163
|
+
'c_evt_hook_add_watcher',
|
|
164
|
+
'c_evt_hook_register_callback',
|
|
165
|
+
'c_evt_hook_pop_callback',
|
|
166
|
+
'c_evt_hook_invoke',
|
|
167
|
+
'evt_hook_ret_code',
|
|
168
|
+
|
|
169
|
+
'EMPTY_ARGS', 'TOPIC_FIELD_NAME',
|
|
170
|
+
|
|
171
|
+
'DEFAULT_MQ_CAPACITY',
|
|
172
|
+
'DEFAULT_MQ_SPIN_LIMIT',
|
|
173
|
+
'DEFAULT_MQ_TIMEOUT_SECONDS',
|
|
174
|
+
'message_queue',
|
|
175
|
+
|
|
176
|
+
'c_mq_new',
|
|
177
|
+
'c_mq_free',
|
|
178
|
+
'c_mq_put',
|
|
179
|
+
'c_mq_get',
|
|
180
|
+
'c_mq_put_await',
|
|
181
|
+
'c_mq_get_await',
|
|
182
|
+
'c_mq_put_busy',
|
|
183
|
+
'c_mq_get_busy',
|
|
184
|
+
'c_mq_put_hybrid',
|
|
185
|
+
'c_mq_get_hybrid',
|
|
186
|
+
'c_mq_occupied',
|
|
187
|
+
|
|
188
|
+
'EventEngine', 'EventEngineEx'
|
|
189
|
+
]
|