chara
10/31/2023, 3:20 PMMarvin
10/31/2023, 3:21 PMchara
10/31/2023, 3:22 PMMarvin
10/31/2023, 3:23 PMchara
10/31/2023, 3:31 PMMarvin
10/31/2023, 3:32 PMcache_result_in_memory
. Here's an example:
python
@flow(cache_result_in_memory=False)
def foo():
return "pretend this is large data"
@task(cache_result_in_memory=False)
def bar():
return "pretend this is biiiig data"
When cache_result_in_memory
is disabled, the result of your flow or task will be persisted by default. The result will then be pulled from storage when needed. Here's an example:
python
@flow
def foo():
result = bar()
state = bar(return_state=True) # The result will be retrieved from storage here
state.result()
future = bar.submit() # The result will be retrieved from storage here
future.result()
@task(cache_result_in_memory=False)
def bar():
return "pretend this is large data"
In this case, the result of the task bar
will be persisted and will be retrieved from storage when needed.
I hope this clarifies things for you. If not, well, I tried.