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
event_engine/__init__.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
__version__ = '0.6.2'
|
|
2
|
+
|
|
3
|
+
import functools
|
|
4
|
+
import pathlib
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
|
|
7
|
+
from .config_view import CONFIG_VIEW
|
|
8
|
+
from .base import LOGGER
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
from .capi import * # noqa: F401,F403
|
|
12
|
+
except Exception as e:
|
|
13
|
+
import warnings
|
|
14
|
+
|
|
15
|
+
warnings.warn(
|
|
16
|
+
f"Failed to import event_engine.capi ({e!r}); falling back to event_engine.native.",
|
|
17
|
+
ImportWarning,
|
|
18
|
+
stacklevel=2,
|
|
19
|
+
)
|
|
20
|
+
from .native import * # noqa: F401,F403
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _format_config_view(config: Mapping, indent: int = 0) -> str:
|
|
24
|
+
"""Render a (possibly nested) config view as indented bullet lines."""
|
|
25
|
+
lines = []
|
|
26
|
+
for key, value in config.items():
|
|
27
|
+
if isinstance(value, Mapping):
|
|
28
|
+
lines.append(f"{' ' * indent}- {key}:")
|
|
29
|
+
lines.append(_format_config_view(value, indent + 1))
|
|
30
|
+
else:
|
|
31
|
+
lines.append(f"{' ' * indent}- {key}: {value}")
|
|
32
|
+
return "\n".join(lines)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@functools.cache
|
|
36
|
+
def get_include() -> list[str]:
|
|
37
|
+
import os
|
|
38
|
+
|
|
39
|
+
res_dir = pathlib.Path(__file__).parent
|
|
40
|
+
LOGGER.info(
|
|
41
|
+
f'Building with <PyEventEngine> version: "{__version__}", resource directory: "{res_dir}", '
|
|
42
|
+
f"config:\n{_format_config_view(CONFIG_VIEW)}"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
scr_dir = [
|
|
46
|
+
os.path.realpath(res_dir),
|
|
47
|
+
os.path.realpath(res_dir / 'base'),
|
|
48
|
+
os.path.realpath(res_dir / 'capi'),
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
include_root = os.path.realpath(res_dir / 'includes')
|
|
52
|
+
if os.path.isdir(include_root):
|
|
53
|
+
scr_dir.append(include_root)
|
|
54
|
+
|
|
55
|
+
return scr_dir
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
__all__ = [
|
|
59
|
+
'CONFIG_VIEW',
|
|
60
|
+
'get_include',
|
|
61
|
+
'LOGGER',
|
|
62
|
+
]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from .c_allocator_protocol cimport (
|
|
2
|
+
EE_LOCAL_ONLY,
|
|
3
|
+
|
|
4
|
+
EE_CFG_LOCKED, EE_CFG_SHARED, EE_CFG_FREELIST,
|
|
5
|
+
EEConfigContext,
|
|
6
|
+
EE_HEAP_ALLOCATOR_RAW, EE_SHM_ALLOCATOR_RAW,
|
|
7
|
+
EE_DEFAULT_ALLOCATOR, EE_SHM_ALLOCATOR, EE_HEAP_ALLOCATOR,
|
|
8
|
+
EE_SHARED, EE_LOCKED, EE_LOCKFREE, EE_FREELIST,
|
|
9
|
+
)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from .c_allocator_protocol cimport (
|
|
2
|
+
EE_LOCAL_ONLY,
|
|
3
|
+
|
|
4
|
+
EE_CFG_LOCKED, EE_CFG_SHARED, EE_CFG_FREELIST,
|
|
5
|
+
EEConfigContext,
|
|
6
|
+
EE_HEAP_ALLOCATOR_RAW, EE_SHM_ALLOCATOR_RAW,
|
|
7
|
+
EE_DEFAULT_ALLOCATOR, EE_SHM_ALLOCATOR, EE_HEAP_ALLOCATOR,
|
|
8
|
+
EE_SHARED, EE_LOCKED, EE_LOCKFREE, EE_FREELIST,
|
|
9
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from cbase.backports.telemetrics import (
|
|
4
|
+
ColoredFormatter,
|
|
5
|
+
DuplicateWarningFilter,
|
|
6
|
+
LOG_LEVEL,
|
|
7
|
+
get_logger as _get_logger,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
LOG_LEVEL_EVENT = LOG_LEVEL - 5
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_logger(**kwargs) -> logging.Logger:
|
|
14
|
+
"""Return the process-wide singleton EventEngine logger.
|
|
15
|
+
|
|
16
|
+
First call configures the logger via PyCyBase's telemetrics; subsequent
|
|
17
|
+
calls return the same cached instance.
|
|
18
|
+
"""
|
|
19
|
+
return _get_logger(name='EventEngine', level=kwargs.get('level', LOG_LEVEL), **kwargs)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
LOGGER = get_logger()
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
'ColoredFormatter',
|
|
26
|
+
'DuplicateWarningFilter',
|
|
27
|
+
'LOG_LEVEL',
|
|
28
|
+
'LOG_LEVEL_EVENT',
|
|
29
|
+
'LOGGER',
|
|
30
|
+
'get_logger',
|
|
31
|
+
]
|