mark doerr
10/01/2024, 8:27 PMNate
10/01/2024, 9:32 PMNate
10/01/2024, 9:32 PMNate
10/01/2024, 9:33 PMprepare_flow_run
in your subclass of BaseWorker
is all you have to do (besides the JobConfiguration
for your worker and the rest of the normal worker things)Nate
10/02/2024, 12:26 AMmark doerr
10/02/2024, 8:19 AMmark doerr
10/02/2024, 9:11 AMBianca Hoch
10/02/2024, 7:19 PMCould you please guide me to the location of the prefect code, where the individual tasks of a flow are executed (be it remotely or locally)Hi Mark! If you're looking for the Prefect code, all of that can be found in this github repo.
Bianca Hoch
10/02/2024, 7:20 PMNate
10/02/2024, 7:26 PMsome_task.fn()
)
β’ send updates to the API when the task changes state (completes, retries, caches, crashes etc)mark doerr
10/02/2024, 8:40 PMmark doerr
10/02/2024, 8:45 PMNate
10/02/2024, 8:51 PMa little bit hidden for a newbe πyep! this is definitely on the low-level side of the SDK, its the "backend" of the
@task
and @flow
decorators that connect your functions to the API, something that users don't often have to directly engage with
a couple callouts that may save some time:
β’ the flow
decorator accepts a task_runner
kwarg which can accept any TaskRunner
implementation
β¦ ConcurrentTaskRunner
- great option (its the default task runner), its really just ThreadPoolExecutor
under the hood, but with nice syntactic sugar (submit / map methods)
β¦ DaskTaskRunner
- requires pip install prefect-dask
but allows you to use an ephemeral or long-lived Dask cluster to send your tasks to (the syntactic sugar remains the same, still just submit / map)mark doerr
10/03/2024, 5:58 AM