# Function Tasks
The tasks in this module can be used to represent arbitrary functions.
In general, users will not instantiate these tasks by hand; they will
automatically be applied when users apply the @task
decorator.
# FunctionTask
A convenience Task for functionally creating Task instances with arbitrary callable run
methods.
Args:
fn (callable)
: the function to be the task'srun
methodname (str, optional)
: the name of this task; if not provided it is inferred as the function name**kwargs
: keyword arguments that will be passed to the Task constructor
ValueError
: if the provided function violates signature requirements for Task run methods
task = FunctionTask(lambda x: x - 42, name="Subtract 42")
with Flow("My Flow") as f:
result = task(42)
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC