# createPollingStrategy

> **createPollingStrategy**(`cfg?`): `PollStrategy`

Defined in: [core/src/utils/polling.ts:250](https://github.com/B3Pay/ic-reactor/blob/ebca60584de1b5acd9e698f0b8af70d26e0fa097/packages/core/src/utils/polling.ts#L250)

Creates an polling strategy for Internet Computer agent update calls.

The strategy implements three phases:
1. **Fast Phase**: Initial rapid polling (default: 10 attempts @ 100ms intervals)
2. **Ramp Phase**: Exponential backoff growth (default: up to 20s elapsed)
3. **Plateau Phase**: Steady-state polling (default: 5s intervals)

The strategy continues polling while request status is RECEIVED/PROCESSING,
and terminates on REPLIED/REJECTED/DONE status, when aborted, or once the
request has been polled for `timeoutMs`.

One strategy can be shared, for example by every update call of a reactor
through its `pollingOptions`. Each request, told apart by its request ID,
gets its own attempt count, clock and timeout, so a call that starts later
still begins in the fast phase.

## Parameters

### cfg?

[`PollingConfig`](https://ic-reactor.b3pay.net/v3/libs/interfaces/pollingconfig/) = `{}`

Configuration options

## Returns

`PollStrategy`

- Async strategy function compatible with agent pollingOptions.strategy

## Example

```typescript
// Basic usage
const strategy = createPollingStrategy();

// Custom configuration for long-running operations
const strategy = createPollingStrategy({
  context: "blockchain-sync",
  fastAttempts: 5,
  fastDelayMs: 200,
  rampUntilMs: 30_000,
  plateauDelayMs: 10_000,
  jitterRatio: 0.3
});

// With abort signal
const controller = new AbortController();
const strategy = createPollingStrategy({
  context: "transaction-signing",
  abortSignal: controller.signal
});
// Later: controller.abort();
```

## Throws

When abortSignal is triggered during polling

## Throws

With `TimeoutWaitingForResponseErrorCode` when a
request has been polled for `timeoutMs`