Skip to content

Runner.connect_to

python
def Runner.connect_to(
  client: Client,
  cluster: ClusterSlugLike | None = None,
) -> TaskRunner

Create a direct runner from a reusable Runner definition and a Tilebox workflows client.

The returned TaskRunner connects to the Tilebox API, advertises the task registrations from the Runner definition, and executes matching tasks from the selected cluster.

Parameters

client Client

Tilebox workflows client used by the direct runner.

cluster str | None

The cluster slug for the runner. If not provided, the default cluster is used.

Example

python
from tilebox.workflows import Client

from my_workflow.runner import runner


client = Client(name="my-workflow-direct")
task_runner = runner.connect_to(
    client, cluster="dev-cluster"
)
task_runner.run_forever()

Type to search…