-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (24 loc) · 822 Bytes
/
main.py
File metadata and controls
30 lines (24 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# for git development repo
from taskcontrol import task, Workflow
# for package
# from taskcontrol import task, Workflow
# Instance of tasks and apis object
# Every instance will store it own list of tasks
# with their before/after middlewares
sparrow = Workflow()
# Example five for decorator usage with kwarg as function
@task(name="taskfive",
task_instance=sparrow,
task_order=4,
shared=False,
args=[1, 2],
# Declare kwargs as a dict object or a function
kwargs={},
after=[],
log=False
)
def taskfive(ctx, result, *args, **kwargs):
print("Running my task function: taskfive")
return args, kwargs
run_0 = sparrow.start(tasks=["taskfive", {}])
print("\nrun_0 2 Tasks [2I]", run_0)