python from taskflow import engines from taskflow.patterns import linear_flow from taskflow.task import Task class TaskA(Task): def execute(self): print("Executing Task A") class TaskB(Task): def execute(self): print("Executing Task B") class TaskC(Task): def execute(self): print("Executing Task C") def main(): flow = linear_flow.Flow("example_flow") with flow: taskA = TaskA() taskB = TaskB() taskC = TaskC() flow.add(taskA, taskB, taskC) flow.link(taskA, taskB) flow.link(taskB, taskC) engine = engines.load(flow) engine.run() if __name__ == '__main__': main()


上一篇:
下一篇:
切换中文