kickoff() Is it thread safe? #1569
Replies: 1 comment
-
|
Here's why: State storage: The flow state is stored in-memory as a Python object Safe approaches:
import threading
from crewai.flow.flow import Flow
def run_flow():
flow = MyFlow() # new instance per thread
flow.kickoff()
threads = [threading.Thread(target=run_flow) for _ in range(5)]
for t in threads:
t.start()
Bottom line: treat each |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to know if this method is thread safe, and if the state in the flow is stored in memory and thread safe
Beta Was this translation helpful? Give feedback.
All reactions