PyEventEngine 0.3.0.post4__tar.gz → 0.3.0.post5__tar.gz

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.
@@ -1,109 +1,109 @@
1
- Metadata-Version: 2.1
2
- Name: PyEventEngine
3
- Version: 0.3.0.post4
4
- Summary: Basic event engine
5
- Home-page: https://github.com/BolunHan/PyEventEngine.git
6
- Author: Bolun.Han
7
- Author-email: Bolun.Han@outlook.com
8
- License: MIT
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE
18
-
19
- # PyEventEngine
20
-
21
- python native event engine
22
-
23
- # Install
24
-
25
- ```shell
26
- pip install git+https://github.com/BolunHan/PyEventEngine.git
27
- ```
28
-
29
- or
30
-
31
- ```shell
32
- pip install PyEventEngine
33
- ```
34
-
35
- # Use
36
-
37
- ## basic usage
38
-
39
- ```python
40
- # init event engine
41
- import time
42
- from event_engine import EventEngine, Topic
43
-
44
- EVENT_ENGINE = EventEngine()
45
- EVENT_ENGINE.start()
46
-
47
-
48
- # register handler
49
- def test_handler(msg, **kwargs):
50
- print(msg)
51
-
52
-
53
- EVENT_ENGINE.register_handler(topic=Topic('SimpleTopic'), handler=test_handler)
54
-
55
- # publish message
56
- EVENT_ENGINE.put(topic=Topic('SimpleTopic'), msg='topic called')
57
- time.sleep(1)
58
- EVENT_ENGINE.stop()
59
- ```
60
-
61
- ## regular topic
62
-
63
- ```python
64
- # init event engine
65
- import time
66
- from event_engine import EventEngine, Topic, RegularTopic
67
-
68
- EVENT_ENGINE = EventEngine()
69
- EVENT_ENGINE.start()
70
-
71
-
72
- # register handler
73
- def test_handler(msg, **kwargs):
74
- print(msg)
75
-
76
-
77
- EVENT_ENGINE.register_handler(topic=RegularTopic('RegularTopic.*'), handler=test_handler)
78
-
79
- # publish message
80
- EVENT_ENGINE.put(topic=Topic('RegularTopic.ChildTopic0'), msg='topic called')
81
- time.sleep(1)
82
- EVENT_ENGINE.stop()
83
- ```
84
-
85
- ## timer topic
86
-
87
- ```python
88
- # init event engine
89
- import time
90
- from event_engine import EventEngine, Topic, RegularTopic
91
-
92
- EVENT_ENGINE = EventEngine()
93
- EVENT_ENGINE.start()
94
-
95
-
96
- # register handler
97
- def test_handler(**kwargs):
98
- print(kwargs)
99
-
100
-
101
- topic = EVENT_ENGINE.get_timer(interval=1)
102
- EVENT_ENGINE.register_handler(topic=topic, handler=test_handler)
103
-
104
- # publish message
105
- time.sleep(5)
106
- EVENT_ENGINE.stop()
107
- ```
108
-
109
- See more advanced usage at .Demo
1
+ Metadata-Version: 2.1
2
+ Name: PyEventEngine
3
+ Version: 0.3.0.post5
4
+ Summary: Basic event engine
5
+ Home-page: https://github.com/BolunHan/PyEventEngine.git
6
+ Author: Bolun.Han
7
+ Author-email: Bolun.Han@outlook.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+
19
+ # PyEventEngine
20
+
21
+ python native event engine
22
+
23
+ # Install
24
+
25
+ ```shell
26
+ pip install git+https://github.com/BolunHan/PyEventEngine.git
27
+ ```
28
+
29
+ or
30
+
31
+ ```shell
32
+ pip install PyEventEngine
33
+ ```
34
+
35
+ # Use
36
+
37
+ ## basic usage
38
+
39
+ ```python
40
+ # init event engine
41
+ import time
42
+ from event_engine import EventEngine, Topic
43
+
44
+ EVENT_ENGINE = EventEngine()
45
+ EVENT_ENGINE.start()
46
+
47
+
48
+ # register handler
49
+ def test_handler(msg, **kwargs):
50
+ print(msg)
51
+
52
+
53
+ EVENT_ENGINE.register_handler(topic=Topic('SimpleTopic'), handler=test_handler)
54
+
55
+ # publish message
56
+ EVENT_ENGINE.put(topic=Topic('SimpleTopic'), msg='topic called')
57
+ time.sleep(1)
58
+ EVENT_ENGINE.stop()
59
+ ```
60
+
61
+ ## regular topic
62
+
63
+ ```python
64
+ # init event engine
65
+ import time
66
+ from event_engine import EventEngine, Topic, RegularTopic
67
+
68
+ EVENT_ENGINE = EventEngine()
69
+ EVENT_ENGINE.start()
70
+
71
+
72
+ # register handler
73
+ def test_handler(msg, **kwargs):
74
+ print(msg)
75
+
76
+
77
+ EVENT_ENGINE.register_handler(topic=RegularTopic('RegularTopic.*'), handler=test_handler)
78
+
79
+ # publish message
80
+ EVENT_ENGINE.put(topic=Topic('RegularTopic.ChildTopic0'), msg='topic called')
81
+ time.sleep(1)
82
+ EVENT_ENGINE.stop()
83
+ ```
84
+
85
+ ## timer topic
86
+
87
+ ```python
88
+ # init event engine
89
+ import time
90
+ from event_engine import EventEngine, Topic, RegularTopic
91
+
92
+ EVENT_ENGINE = EventEngine()
93
+ EVENT_ENGINE.start()
94
+
95
+
96
+ # register handler
97
+ def test_handler(**kwargs):
98
+ print(kwargs)
99
+
100
+
101
+ topic = EVENT_ENGINE.get_timer(interval=1)
102
+ EVENT_ENGINE.register_handler(topic=topic, handler=test_handler)
103
+
104
+ # publish message
105
+ time.sleep(5)
106
+ EVENT_ENGINE.stop()
107
+ ```
108
+
109
+ See more advanced usage at .Demo
@@ -1,109 +1,109 @@
1
- Metadata-Version: 2.1
2
- Name: PyEventEngine
3
- Version: 0.3.0.post4
4
- Summary: Basic event engine
5
- Home-page: https://github.com/BolunHan/PyEventEngine.git
6
- Author: Bolun.Han
7
- Author-email: Bolun.Han@outlook.com
8
- License: MIT
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Operating System :: OS Independent
15
- Requires-Python: >=3.8
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE
18
-
19
- # PyEventEngine
20
-
21
- python native event engine
22
-
23
- # Install
24
-
25
- ```shell
26
- pip install git+https://github.com/BolunHan/PyEventEngine.git
27
- ```
28
-
29
- or
30
-
31
- ```shell
32
- pip install PyEventEngine
33
- ```
34
-
35
- # Use
36
-
37
- ## basic usage
38
-
39
- ```python
40
- # init event engine
41
- import time
42
- from event_engine import EventEngine, Topic
43
-
44
- EVENT_ENGINE = EventEngine()
45
- EVENT_ENGINE.start()
46
-
47
-
48
- # register handler
49
- def test_handler(msg, **kwargs):
50
- print(msg)
51
-
52
-
53
- EVENT_ENGINE.register_handler(topic=Topic('SimpleTopic'), handler=test_handler)
54
-
55
- # publish message
56
- EVENT_ENGINE.put(topic=Topic('SimpleTopic'), msg='topic called')
57
- time.sleep(1)
58
- EVENT_ENGINE.stop()
59
- ```
60
-
61
- ## regular topic
62
-
63
- ```python
64
- # init event engine
65
- import time
66
- from event_engine import EventEngine, Topic, RegularTopic
67
-
68
- EVENT_ENGINE = EventEngine()
69
- EVENT_ENGINE.start()
70
-
71
-
72
- # register handler
73
- def test_handler(msg, **kwargs):
74
- print(msg)
75
-
76
-
77
- EVENT_ENGINE.register_handler(topic=RegularTopic('RegularTopic.*'), handler=test_handler)
78
-
79
- # publish message
80
- EVENT_ENGINE.put(topic=Topic('RegularTopic.ChildTopic0'), msg='topic called')
81
- time.sleep(1)
82
- EVENT_ENGINE.stop()
83
- ```
84
-
85
- ## timer topic
86
-
87
- ```python
88
- # init event engine
89
- import time
90
- from event_engine import EventEngine, Topic, RegularTopic
91
-
92
- EVENT_ENGINE = EventEngine()
93
- EVENT_ENGINE.start()
94
-
95
-
96
- # register handler
97
- def test_handler(**kwargs):
98
- print(kwargs)
99
-
100
-
101
- topic = EVENT_ENGINE.get_timer(interval=1)
102
- EVENT_ENGINE.register_handler(topic=topic, handler=test_handler)
103
-
104
- # publish message
105
- time.sleep(5)
106
- EVENT_ENGINE.stop()
107
- ```
108
-
109
- See more advanced usage at .Demo
1
+ Metadata-Version: 2.1
2
+ Name: PyEventEngine
3
+ Version: 0.3.0.post5
4
+ Summary: Basic event engine
5
+ Home-page: https://github.com/BolunHan/PyEventEngine.git
6
+ Author: Bolun.Han
7
+ Author-email: Bolun.Han@outlook.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+
19
+ # PyEventEngine
20
+
21
+ python native event engine
22
+
23
+ # Install
24
+
25
+ ```shell
26
+ pip install git+https://github.com/BolunHan/PyEventEngine.git
27
+ ```
28
+
29
+ or
30
+
31
+ ```shell
32
+ pip install PyEventEngine
33
+ ```
34
+
35
+ # Use
36
+
37
+ ## basic usage
38
+
39
+ ```python
40
+ # init event engine
41
+ import time
42
+ from event_engine import EventEngine, Topic
43
+
44
+ EVENT_ENGINE = EventEngine()
45
+ EVENT_ENGINE.start()
46
+
47
+
48
+ # register handler
49
+ def test_handler(msg, **kwargs):
50
+ print(msg)
51
+
52
+
53
+ EVENT_ENGINE.register_handler(topic=Topic('SimpleTopic'), handler=test_handler)
54
+
55
+ # publish message
56
+ EVENT_ENGINE.put(topic=Topic('SimpleTopic'), msg='topic called')
57
+ time.sleep(1)
58
+ EVENT_ENGINE.stop()
59
+ ```
60
+
61
+ ## regular topic
62
+
63
+ ```python
64
+ # init event engine
65
+ import time
66
+ from event_engine import EventEngine, Topic, RegularTopic
67
+
68
+ EVENT_ENGINE = EventEngine()
69
+ EVENT_ENGINE.start()
70
+
71
+
72
+ # register handler
73
+ def test_handler(msg, **kwargs):
74
+ print(msg)
75
+
76
+
77
+ EVENT_ENGINE.register_handler(topic=RegularTopic('RegularTopic.*'), handler=test_handler)
78
+
79
+ # publish message
80
+ EVENT_ENGINE.put(topic=Topic('RegularTopic.ChildTopic0'), msg='topic called')
81
+ time.sleep(1)
82
+ EVENT_ENGINE.stop()
83
+ ```
84
+
85
+ ## timer topic
86
+
87
+ ```python
88
+ # init event engine
89
+ import time
90
+ from event_engine import EventEngine, Topic, RegularTopic
91
+
92
+ EVENT_ENGINE = EventEngine()
93
+ EVENT_ENGINE.start()
94
+
95
+
96
+ # register handler
97
+ def test_handler(**kwargs):
98
+ print(kwargs)
99
+
100
+
101
+ topic = EVENT_ENGINE.get_timer(interval=1)
102
+ EVENT_ENGINE.register_handler(topic=topic, handler=test_handler)
103
+
104
+ # publish message
105
+ time.sleep(5)
106
+ EVENT_ENGINE.stop()
107
+ ```
108
+
109
+ See more advanced usage at .Demo
@@ -8,6 +8,7 @@ PyEventEngine.egg-info/dependency_links.txt
8
8
  PyEventEngine.egg-info/top_level.txt
9
9
  event_engine/__init__.py
10
10
  event_engine/cpp/topic_api.cpp
11
+ event_engine/cpp/topic_api.cpp
11
12
  event_engine/native/__init__.py
12
13
  event_engine/native/_event.py
13
14
  event_engine/native/_topic.py
@@ -0,0 +1,3 @@
1
+ __version__ = '0.3.0.post5'
2
+
3
+ from .native import *
@@ -281,6 +281,10 @@ class EventEngineBase(object):
281
281
  def buffer_size(self):
282
282
  return self._buffer_size
283
283
 
284
+ @property
285
+ def active(self) -> bool:
286
+ return self._active
287
+
284
288
 
285
289
  class EventEngine(EventEngineBase):
286
290
  EventHook = EventHook
@@ -1,7 +1,7 @@
1
- [metadata]
2
- description-file = README.md
3
-
4
- [egg_info]
5
- tag_build =
6
- tag_date = 0
7
-
1
+ [metadata]
2
+ description-file = README.md
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+
@@ -1,3 +0,0 @@
1
- __version__ = '0.3.0.post4'
2
-
3
- from .native import *