# TaskRunner.RunForever

```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**

`context.Context`

required: true

The context controlling the runner lifetime.

## Returns

An error if the polling loop fails.

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