Overview

Prev Next

Polling Manager

Purpose

The Polling Manager provides a centralized polling runtime for OneCMS internal consumers.

It treats polling as infrastructure, not component-level timer logic.

If consumers need to reason about timer ownership, dedup internals, or pause/resume mechanics to use it safely, the abstraction has failed.

What This Module Is

  • A process-wide infrastructure primitive
  • Keyed task orchestration with shared deduplication
  • Ref-counted subscription lifecycle management
  • Visibility-aware polling control when a document reference is provided
  • Transport-agnostic (pollFn can call REST, GraphQL, SDK, or other sources)

What This Module Is Not

The Polling Manager is not:

  • A React hook
  • A domain runtime
  • A replacement for domain stop logic
  • A module-specific polling implementation

It does not define key semantics, terminal states, or domain interpretation rules.

Public Surface

The public API is defined by index.ts:

export { PollingManager, pollingManager } from './core';
export type {
  PollingDocument,
  PollingManagerDeps,
  PollingManagerStatus,
  PollingScheduler,
  PollingStatus,
  PollingSubscriptionId,
  PollingTaskStatus,
  SubscribeOptions,
  SubscribeResult,
  SubscriptionCallbackUpdates,
  UnsubscribeFn,
} from './core/types';

Everything else is private implementation detail.

Architecture

Image

Related ADRs

  • ADR-029: Centralized Polling Manager
  • ADR-021: Live Stream Runtime Boundary

ADR-029 defines centralized polling infrastructure. ADR-021 remains the domain boundary for live-stream decisioning.

Further Reading

  • API
  • Boundaries
  • Invariants
  • Examples
  • Testing