-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
- Cache the launcher function's output
- Cache the file output: check if specified output file are exist, and only start the job when file not exist.
Example:
@launcher(cache='disk')
def add(a, b):
return a + b
res = add(1, 2) # will start job
res = add(1, 2) # will directly load result from cache
# cache file output
from executor.engine.launcher import file_output
@launcher(cache='disk')
@file_output('{name}.txt')
def generate_hellos(name: str, times: int):
with open(name + '.txt', 'w') as f:
for _ in range(times):
f.write(f"Hello {name}\n")
generate_hellos('Tom', 10) # will start job
generate_hellos('Tom', 10) # will not start job
generate_hellos('Mike', 10) # will start job
Metadata
Metadata
Assignees
Labels
No labels