Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions COMPILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@

* 通过uv安装(Linux/MacOS/Windows)
```shell
$ uv init cgraph_env # 通过uv 创建一个名为 cgraph_env 的环境
$ cd cgraph_env
$ uv add "pycgraph @ git+https://github.com/ChunelFeng/CGraph.git@main#subdirectory=python" --marker "sys_platform == 'linux'" # 添加 pycgraph 依赖
$ python3 -c "import pycgraph" # 验证 pycgraph 成功安装
$ uv init pycgraph_env # 通过uv 创建一个名为 pycgraph_env 项目目录
$ cd pycgraph_env
$ uv add pycgraph # 添加 pycgraph 依赖
$ uv run python -c "import pycgraph" # 验证 pycgraph 成功安装
```
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ Contributors:
- [guanquanchen](https://github.com/guanquanchen)
- [Linyu](https://github.com/weijinglin)
- [billlib](https://github.com/billlib)
- [SimonFoobar648](https://github.com/SimonFoobar648)

感谢以上朋友,为CGraph项目做出的贡献,排名以贡献时间前后为顺序。
3 changes: 2 additions & 1 deletion python/tutorial/T01-Simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ def tutorial_simple():
pipeline.registerGElement(d, {b, c}, "nodeD")

status: CStatus = pipeline.init()
if status.isErr():
if not status:
# please check api return status
# ret_code == 0 is ok, default
# ret_code < 0 means error, ex: return CStatus(-1, "my error info")
# never try ret_code > 0 please
print('pipeline init failed, error code is {0}, error info is {1}'.format(
status.getCode(), status.getInfo()))
return
Expand Down
1 change: 1 addition & 0 deletions python/tutorial/T09-Aspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def tutorial_aspect():
pipeline.registerGElement(a, set(), 'nodeA')
pipeline.registerGElement(b_cluster, {a}, 'regionB')
pipeline.registerGElement(c, {b_cluster}, 'nodeC')

pipeline.process()


Expand Down
1 change: 1 addition & 0 deletions python/tutorial/T10-AspectParam.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def tutorial_aspect_param():
pipeline.registerGElement(b, {a}, 'nodeB')
pipeline.registerGElement(c, {b}, 'nodeC')
pipeline.registerGElement(d, {c}, 'nodeD')

pipeline.process()


Expand Down
6 changes: 2 additions & 4 deletions python/tutorial/T19-Cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ def tutorial_cancel():
result: StdFutureCStatus = pipeline.asyncRun()
print("pipeline async run first time, BEGIN.")
result.wait()
print("pipeline async run first time, FINISH.")
print("======================")
print("pipeline async run first time, FINISH ======")

result = pipeline.asyncRun()
time.sleep(1.5)
pipeline.cancel()
print("pipeline async run second time, CANCEL.")
print("======================")
print("pipeline async run second time, CANCEL ======")
result.wait()

pipeline.destroy()
Expand Down
4 changes: 2 additions & 2 deletions python/tutorial/T22-Timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tutorial_timeout():
pipeline.registerGElement(d, {b, c}, "nodeD")

status: CStatus = pipeline.process()
if status.isOK():
if status:
print("---- T22-timeout.py pipeline run finish \n")

c.setTimeout(300)
Expand All @@ -34,7 +34,7 @@ def tutorial_timeout():
c.setTimeout(0)
print("---- set [{0}] no timeout, rerun pipeline again".format(c.getName()))
status = pipeline.process()
if status.isOK():
if status:
print("---- T22-timeout.py pipeline run finish again")


Expand Down
1 change: 0 additions & 1 deletion src/UtilsCtrl/ThreadPool/UThreadPoolConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <algorithm>

#include "UThreadObject.h"
#include "UThreadPoolDefine.h"

CGRAPH_NAMESPACE_BEGIN
Expand Down
2 changes: 2 additions & 0 deletions tutorial/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cc_library(
"MyGDaemon/**/*.h",
"MyGEvent/**/*.h",
"MyGMutable/**/*.h",
"MyGSome/**/*.h",
"MyGNode/**/*.h",
"MyParams/**/*.h",]),
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -40,6 +41,7 @@ CGRAPH_TUTORIAL_LIST = [
"T26-Mutable",
"T27-Trim",
"T28-Stage",
"T29-Storage",
]

[
Expand Down
2 changes: 1 addition & 1 deletion tutorial/T01-Simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void tutorial_simple() {
status += pipeline->registerGElement<MyNode2>(&b, {a}, "nodeB"); // 将名为nodeB,依赖a执行的node信息,注册入pipeline中
status += pipeline->registerGElement<MyNode1>(&c, {a}, "nodeC");
status += pipeline->registerGElement<MyNode2>(&d, {b, c}, "nodeD"); // 将名为nodeD,依赖{b,c}执行的node信息,注册入pipeline中
if (!status.isOK()) {
if (!status) {
return; // 使用时,请对所有CGraph接口的返回值做判定。今后tutorial例子中省略该操作。
}

Expand Down
2 changes: 1 addition & 1 deletion tutorial/T05-Param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void tutorial_param() {
status += pipeline->registerGElement<MyWriteParamNode>(&d, {a}, "writeNodeD", 2); // 对param中的iValue值+1,循环执行2次
status += pipeline->registerGElement<MyReadParamNode>(&e, {a}, "readNodeE");
status += pipeline->registerGElement<MyWriteParamNode>(&f, {b, c, d, e}, "writeNodeF");
if (!status.isOK()) {
if (!status) {
return; // 使用时,请对所有CGraph接口的返回值做判定。本例子中省略
}

Expand Down
2 changes: 1 addition & 1 deletion tutorial/T06-Condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void tutorial_condition() {
status += pipeline->registerGElement<MyCondition>(&b_condition, {a}, "conditionB", 1);
status += pipeline->registerGElement<MyReadParamNode>(&c, {b_condition}, "readNodeC", 1);
status += pipeline->registerGElement<MyParamCondition>(&d_condition, {c}, "conditionD", 1);
if (!status.isOK()) {
if (!status) {
return;
}

Expand Down
Loading