Skip to main content
def Client.runner(
  cluster: ClusterSlugLike | None = None,
  tasks: list[type[Task]],
  cache: JobCache | None = None
) -> TaskRunner
Initialize a task runner.

Parameters

cluster
str | None
The cluster slug for the cluster associated with this task runner. If not provided, the default cluster is used.
tasks
list[type[Task]]
A list of task classes that this runner can execute.
cache
JobCache
An optional job cache for caching results from tasks and sharing data between tasks.
from tilebox.workflows import Client
from tilebox.workflows.cache import LocalFileSystemCache

client = Client()
runner = client.runner(
    tasks=[MyFirstTask, MySubtask],
    # optional:
    cache=LocalFileSystemCache("cache_directory"),
)