Cody
08/31/2023, 3:35 PMMarvin
08/31/2023, 3:35 PM@task
decorator. These tasks are atomic pieces of work that can be executed independently within a flow. When a function becomes a task, it can be executed concurrently and its return value can be cached.
As for your question about making a Class's method a task, it's not directly supported. Tasks in Prefect are designed to be standalone functions, not methods of a class. However, you could potentially wrap a class method inside a standalone function and then decorate that function as a task.
Just remember, all tasks must be called from within a flow, they may not be called from other tasks. Isn't programming just a bundle of laughs?