---
title: "Client.NewPollingTaskRunner"
description: "Create a polling runner for a custom task executor."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://tilebox.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Client.NewPollingTaskRunner

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```go
func (*Client) NewPollingTaskRunner(
    ctx context.Context,
    executor workflows.TaskExecutor,
    options ...runner.Option,
) (*workflows.PollingTaskRunner, error)
```

Create a polling runner for a custom task executor.

Use this lower-level runner when you need a custom execution backend, such as a dynamic runtime, but still want the Tilebox polling protocol to request, lease, and report tasks.

## Parameters

**executor**

type: workflows.TaskExecutor

required: true

The executor that reports task capabilities and executes leased tasks.
**options**

type: []runner.Option

Options for initializing the polling runner.

## Options

**runner.WithClusterSlug(clusterSlug string)**

default: 

The cluster to poll for tasks. If not provided, the default cluster is used.
**runner.WithRunnerLogger(logger *slog.Logger)**

default: slog.Default()

Set the logger to use for the polling runner.

## Returns

The created polling runner.

<h2 id="request-example">Usage example</h2>

```go
runner, err := client.NewPollingTaskRunner(
    ctx,
    executor,
)
```

Source: https://tilebox.com/docs/api-reference/go/workflows/NewPollingTaskRunner/index.mdx
