---
title: "PollingTaskRunner.RunForever"
description: "Run the polling runner continuously, polling for tasks when idle."
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.

# PollingTaskRunner.RunForever

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

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

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

```go
func (*PollingTaskRunner) RunForever(ctx context.Context) error
```

Run the polling runner continuously, polling for tasks when idle.

## Parameters

**ctx**

type: context.Context

required: true

The context controlling the polling loop lifetime.

## Returns

An error if the polling loop fails.

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

```go
if err := runner.RunForever(ctx); err != nil {
    return err
}
```

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