MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / tutorial_timeout

Function tutorial_timeout

python/tutorial/T22-Timeout.py:15–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def tutorial_timeout():
16 pipeline = GPipeline()
17 a, b, c, d = MyNode1(), MyNode2(), MyNode1(), MyNode1()
18
19 pipeline.registerGElement(a, set(), "nodeA")
20 pipeline.registerGElement(b, {a}, "nodeB")
21 pipeline.registerGElement(c, {a}, "nodeC")
22 pipeline.registerGElement(d, {b, c}, "nodeD")
23
24 status: CStatus = pipeline.process()
25 if status.isOK():
26 print("---- T22-timeout.py pipeline run finish \n")
27
28 c.setTimeout(300)
29 print("---- set [{0}] timeout value to 300".format(c.getName()))
30 status = pipeline.process()
31 if not status.isOK():
32 print("---- T22-timeout pipeline run error info : {0} \n".format(status.getInfo()))
33
34 c.setTimeout(0)
35 print("---- set [{0}] no timeout, rerun pipeline again".format(c.getName()))
36 status = pipeline.process()
37 if status.isOK():
38 print("---- T22-timeout.py pipeline run finish again")
39
40
41if __name__ == '__main__':

Callers 1

T22-Timeout.pyFile · 0.70

Calls 6

processMethod · 0.95
MyNode1Class · 0.90
MyNode2Class · 0.90
GPipelineClass · 0.85
isOKMethod · 0.80
setTimeoutMethod · 0.80

Tested by

no test coverage detected