Event Polling
The SDK provides apollThreadEvents utility for continuously polling thread events with built-in abort support.
pollThreadEvents
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fetcher | (afterSeq: number) => Promise<ThreadEventPollResponse> | Yes | Function that fetches events |
onEvent | (event: ThreadEvent) => void | Yes | Called for each event |
startSeq | number | No | Starting sequence number (default: 0) |
options | PollOptions | No | Configuration options |
PollOptions
Stopping the Poll
UseAbortController to gracefully stop polling:
