PyEventEngine 0.6.0.post3__cp313-cp313-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 +37 -0
- event_engine/base/__infra__.pxd +9 -0
- event_engine/base/__init__.pxd +9 -0
- event_engine/base/__init__.py +82 -0
- event_engine/base/c_allocator_protocol.c +10817 -0
- event_engine/base/c_allocator_protocol.cp313-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 +99 -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 +28711 -0
- event_engine/capi/c_engine.cp313-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 +424 -0
- event_engine/capi/c_engine.pyx +560 -0
- event_engine/capi/c_event.c +19921 -0
- event_engine/capi/c_event.cp313-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 +226 -0
- event_engine/capi/c_event.pyx +387 -0
- event_engine/capi/c_topic.c +30978 -0
- event_engine/capi/c_topic.cp313-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 +580 -0
- event_engine/capi/c_topic.pyx +725 -0
- event_engine/capi/fallback_engine.py +670 -0
- event_engine/includes/event_engine/base/c_allocator_protocol.c +10817 -0
- event_engine/includes/event_engine/base/c_allocator_protocol.h +23 -0
- event_engine/includes/event_engine/capi/c_engine.c +28711 -0
- event_engine/includes/event_engine/capi/c_engine.h +393 -0
- event_engine/includes/event_engine/capi/c_event.c +19921 -0
- event_engine/includes/event_engine/capi/c_event.h +342 -0
- event_engine/includes/event_engine/capi/c_topic.c +30978 -0
- event_engine/includes/event_engine/capi/c_topic.h +1007 -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 +746 -0
- event_engine/native/event.py +467 -0
- event_engine/native/topic.py +945 -0
- pyeventengine-0.6.0.post3.dist-info/METADATA +189 -0
- pyeventengine-0.6.0.post3.dist-info/RECORD +52 -0
- pyeventengine-0.6.0.post3.dist-info/WHEEL +5 -0
- pyeventengine-0.6.0.post3.dist-info/licenses/LICENSE +21 -0
- pyeventengine-0.6.0.post3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
from libc.stdint cimport uint64_t
|
|
2
|
+
|
|
3
|
+
from cbase.allocator_protocol.c_allocator_protocol cimport allocator_protocol
|
|
4
|
+
from cbase.bytemap.c_bytemap cimport bytemap
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
cdef extern from "event_engine/capi/c_topic.h":
|
|
8
|
+
const char DEFAULT_TOPIC_SEP
|
|
9
|
+
const char DEFAULT_OPTION_SEP
|
|
10
|
+
const char* DEFAULT_RANGE_BRACKETS
|
|
11
|
+
const char* DEFAULT_WILDCARD_BRACKETS
|
|
12
|
+
const char DEFAULT_WILDCARD_MARKER
|
|
13
|
+
const char DEFAULT_PATTERN_DELIM
|
|
14
|
+
bytemap* GLOBAL_INTERNAL_MAP
|
|
15
|
+
|
|
16
|
+
ctypedef enum evt_topic_type:
|
|
17
|
+
TOPIC_PART_EXACT = 0
|
|
18
|
+
TOPIC_PART_ANY = 1
|
|
19
|
+
TOPIC_PART_RANGE = 2
|
|
20
|
+
TOPIC_PART_PATTERN = 3
|
|
21
|
+
|
|
22
|
+
ctypedef struct evt_topic_part:
|
|
23
|
+
evt_topic_type ttype
|
|
24
|
+
evt_topic_part_variant* next
|
|
25
|
+
|
|
26
|
+
ctypedef struct evt_topic_exact:
|
|
27
|
+
evt_topic_part header
|
|
28
|
+
char* part
|
|
29
|
+
size_t part_len
|
|
30
|
+
|
|
31
|
+
ctypedef struct evt_topic_any:
|
|
32
|
+
evt_topic_part header
|
|
33
|
+
char* name
|
|
34
|
+
size_t name_len
|
|
35
|
+
|
|
36
|
+
ctypedef struct evt_topic_range:
|
|
37
|
+
evt_topic_part header
|
|
38
|
+
char** options
|
|
39
|
+
size_t* option_length
|
|
40
|
+
size_t num_options
|
|
41
|
+
char* literal
|
|
42
|
+
size_t literal_len
|
|
43
|
+
|
|
44
|
+
ctypedef struct evt_topic_pattern:
|
|
45
|
+
evt_topic_part header
|
|
46
|
+
char* pattern
|
|
47
|
+
size_t pattern_len
|
|
48
|
+
|
|
49
|
+
ctypedef union evt_topic_part_variant:
|
|
50
|
+
evt_topic_part header
|
|
51
|
+
evt_topic_exact exact
|
|
52
|
+
evt_topic_any any
|
|
53
|
+
evt_topic_range range
|
|
54
|
+
evt_topic_pattern pattern
|
|
55
|
+
|
|
56
|
+
ctypedef struct evt_topic:
|
|
57
|
+
evt_topic_part_variant* parts
|
|
58
|
+
size_t n
|
|
59
|
+
uint64_t hash
|
|
60
|
+
char* key
|
|
61
|
+
size_t key_len
|
|
62
|
+
int is_exact
|
|
63
|
+
|
|
64
|
+
ctypedef struct evt_topic_match:
|
|
65
|
+
int matched
|
|
66
|
+
evt_topic_part_variant* part_a
|
|
67
|
+
evt_topic_part_variant* part_b
|
|
68
|
+
char* literal
|
|
69
|
+
size_t literal_len
|
|
70
|
+
evt_topic_match* next
|
|
71
|
+
|
|
72
|
+
bytemap* c_get_global_internal_map(allocator_protocol* allocator) noexcept nogil
|
|
73
|
+
evt_topic* c_topic_new(const char* key, size_t key_len, allocator_protocol* allocator) noexcept nogil
|
|
74
|
+
void c_topic_free(evt_topic* topic) noexcept nogil
|
|
75
|
+
int c_topic_internalize(evt_topic* topic, const char* key, size_t key_len) noexcept nogil
|
|
76
|
+
int c_topic_append(evt_topic* topic, const char* s, size_t len, evt_topic_type ttype) noexcept nogil
|
|
77
|
+
int c_topic_parse(evt_topic* topic, const char* key, size_t key_len) noexcept nogil
|
|
78
|
+
int c_topic_assign(evt_topic* topic, const char* key, size_t key_len) noexcept nogil
|
|
79
|
+
int c_topic_update_literal(evt_topic* topic) noexcept nogil
|
|
80
|
+
evt_topic_match* c_topic_match(evt_topic* topic_a, evt_topic* topic_b, evt_topic_match* out) noexcept nogil
|
|
81
|
+
evt_topic_match* c_topic_match_new(evt_topic_match* prev, allocator_protocol* allocator) noexcept nogil
|
|
82
|
+
void c_topic_match_free(evt_topic_match* res) noexcept nogil
|
|
83
|
+
int c_topic_match_bool(evt_topic* topic_a, evt_topic* topic_b) noexcept nogil
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
cdef class TopicPart:
|
|
87
|
+
cdef evt_topic_part_variant* header
|
|
88
|
+
cdef readonly bint owner
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
cdef TopicPart c_from_header(evt_topic_part_variant* header, bint owner=?)
|
|
92
|
+
|
|
93
|
+
cdef object c_cast(self)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
cdef class TopicPartExact(TopicPart):
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
cdef class TopicPartAny(TopicPart):
|
|
101
|
+
pass
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
cdef class TopicPartRange(TopicPart):
|
|
105
|
+
pass
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
cdef class TopicPartPattern(TopicPart):
|
|
109
|
+
pass
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
cdef allocator_protocol* TOPIC_ALLOCATOR
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
cpdef Topic get_internal_topic(str key, bint owner=?)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
cpdef dict get_internal_map()
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
cdef class TopicMatchResult:
|
|
122
|
+
cdef evt_topic_match* header
|
|
123
|
+
cdef bint owner
|
|
124
|
+
|
|
125
|
+
@staticmethod
|
|
126
|
+
cdef dict c_match_res(evt_topic_match* node)
|
|
127
|
+
|
|
128
|
+
@staticmethod
|
|
129
|
+
cdef TopicMatchResult c_from_header(evt_topic_match* node, bint owner=?)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
cdef class Topic:
|
|
133
|
+
cdef evt_topic* header
|
|
134
|
+
cdef readonly bint owner
|
|
135
|
+
|
|
136
|
+
@staticmethod
|
|
137
|
+
cdef Topic c_from_header(evt_topic* header, bint owner=?)
|
|
138
|
+
|
|
139
|
+
cdef void c_append(self, evt_topic_part_variant* tpart)
|
|
140
|
+
|
|
141
|
+
cdef void c_update_literal(self)
|
|
142
|
+
|
|
143
|
+
cpdef Topic append(self, TopicPart topic_part)
|
|
144
|
+
|
|
145
|
+
cpdef TopicMatchResult match(self, Topic other)
|
|
146
|
+
|
|
147
|
+
cpdef Topic format_map(self, dict mapping, bint internalized=?, bint strict=?)
|