Skip to content

miniproto.updates.manager.UpdateManager

UpdateManager(config: ClientConfig, storage: SessionStorage, invoke: UpdateInvoker) -> None

Process Telegram updates into public events while persisting recovery state.

Parameters:

  • config (ClientConfig) – Client configuration defining queue capacities, overflow policy, and duplicate-window size.
  • storage (SessionStorage) – Session storage used to load and atomically persist update cursors and discovered entities.
  • invoke (UpdateInvoker) – Async raw-RPC invoker used for updates.getState and difference recovery.
Lifecycle

start restores state and launches a raw-update drainer. stop cancels that drainer but does not close or sentinel the public queue; consumers of iter_updates remain blocked until cancellation or a future event.

Persistence

Raw update processing holds a state lock, applies cursor/entity/duplicate changes, and persists them before emitted public events are queued and handlers are called. Persisted state is therefore ahead of, or equal to, observable delivery; it does not provide application-level exactly-once handling.

Initialize bounded raw/public queues and uninitialized persistent cursor state.

Parameters:

  • config (ClientConfig) – Client queue capacities, overflow policy, and duplicate-window settings.
  • storage (SessionStorage) – Session storage used to load and atomically persist cursor state.
  • invoke (UpdateInvoker) – Async raw-RPC callable used for state and difference recovery.