Skip to content

Commit fef018c

Browse files
committed
docs(remove): add docs for remove_flow()
1 parent bc07b72 commit fef018c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/docs/core/flow_def.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ demo_flow = cocoindex.add_flow_def("DemoFlow", demo_flow_def)
4646
In both cases, `demo_flow` will be an object with `cocoindex.Flow` class type.
4747
See [Flow Running](/docs/core/flow_methods) for more details on it.
4848

49+
Sometimes you no longer want to keep states of the flow in memory. We provide a `cocoindex.remove_flow()` method for this purpose:
50+
51+
```python
52+
cocoindex.remove_flow(demo_flow)
53+
```
54+
55+
After it's called, `demo_flow` becomes an invalid object, and you should not call any methods of it.
56+
57+
:::note
58+
59+
This only removes states of the flow from the current process, and it won't affect the persistent states.
60+
61+
If you w
62+
63+
:::
64+
4965
</TabItem>
5066
</Tabs>
5167

docs/docs/core/flow_methods.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ cocoindex.drop_all_flows(report_to_stdout=True)
100100
</TabItem>
101101
</Tabs>
102102

103+
:::note
104+
105+
After dropping the flow, the in-memory `cocoindex.Flow` instance is still valid, and you can call setup methods on it again.
106+
107+
If you want to remove the flow from the current process, you can call `cocoindex.remove_flow(demo_flow)` to do so (see [related doc](/docs/core/flow_def#entry-point)).
108+
109+
:::
110+
103111
## Build / update target data
104112

105113
The major goal of a flow is to perform the transformations on source data and build / update data in the target.

0 commit comments

Comments
 (0)