This commit is contained in:
parent
fd0dee5e3e
commit
73dd62135b
|
|
@ -100,6 +100,13 @@ A **Flow** can act like a Node, which enables powerful composition patterns. Thi
|
||||||
2. Combine multiple smaller Flows into a larger Flow for reuse.
|
2. Combine multiple smaller Flows into a larger Flow for reuse.
|
||||||
3. Node `params` will be a merging of **all** parents' `params`.
|
3. Node `params` will be a merging of **all** parents' `params`.
|
||||||
|
|
||||||
|
> While **Flow** is also a **Node**, it won't run `exec()`.
|
||||||
|
>
|
||||||
|
> It will run `prep()` and `post()`, before and after calling the nodes within the flow.
|
||||||
|
>
|
||||||
|
> However, `post()` always receives None for exec_res, and should instead get the flow execution results from the shared store.
|
||||||
|
{: .warning }
|
||||||
|
|
||||||
### Basic Flow Nesting
|
### Basic Flow Nesting
|
||||||
|
|
||||||
Here's how to connect a flow to another node:
|
Here's how to connect a flow to another node:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Node(BaseNode):
|
||||||
if self.wait>0: time.sleep(self.wait)
|
if self.wait>0: time.sleep(self.wait)
|
||||||
|
|
||||||
class BatchNode(Node):
|
class BatchNode(Node):
|
||||||
def _exec(self,items): return [super(BatchNode,self)._exec(i) for i in items]
|
def _exec(self,items): return [super(BatchNode,self)._exec(i) for i in (items or [])]
|
||||||
|
|
||||||
class Flow(BaseNode):
|
class Flow(BaseNode):
|
||||||
def __init__(self,start): super().__init__();self.start=start
|
def __init__(self,start): super().__init__();self.start=start
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue