forked from ChunelFeng/CGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT10-AspectParam.py
More file actions
31 lines (23 loc) · 756 Bytes
/
T10-AspectParam.py
File metadata and controls
31 lines (23 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: T10-AspectParam
@Time: 2025/3/30 21:11
@Desc:
"""
from PyCGraph import GPipeline
from MyGNode.MyNode1 import MyNode1
from MyGNode.MyNode2 import MyNode2
from MyGAspect.MyConnApsect import MyConnAspect
def tutorial_aspect_param():
a, b, c, d = MyNode1(), MyNode2(), MyNode1(), MyNode2()
a.addGAspect(MyConnAspect('127.0.0.1', 6666))
d.addGAspect(MyConnAspect('255.255.255.255', 9999))
pipeline = GPipeline()
pipeline.registerGElement(a, set(), 'nodeA')
pipeline.registerGElement(b, {a}, 'nodeB')
pipeline.registerGElement(c, {b}, 'nodeC')
pipeline.registerGElement(d, {c}, 'nodeD')
pipeline.process()
if __name__ == '__main__':
tutorial_aspect_param()