---
title: "TaskRunner.RunForever"
description: "Run the 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.

# TaskRunner.RunForever

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

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

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

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

Run the runner continuously, polling for tasks when idle.

`RunForever` stops when the context is canceled or when the process receives a supported shutdown signal.

## Parameters

**ctx**

type: context.Context

required: true

The context controlling the runner 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/TaskRunner.RunForever/index.mdx
