Package 

Object ConfigManager

    • Method Detail

      • fetch

         final AppConfiguration fetch()

        Single-shot fetch attempt. Returns the parsed config and applies it on HTTP 2xx, or returns null (and leaves the existing current in place) on any non-2xx, transport error, or decode failure. Useful for best-effort refreshes (e.g. after setAPIKey) where the caller doesn't want to block on the retry loop. Production session-start callers should use ensureLoaded instead.

      • ensureLoaded

         final AppConfiguration ensureLoaded()

        Returns the loaded config, blocking until a fetch has succeeded.

        On first call (or after every process restart) this drives an exponential-backoff retry loop — 1 s → 2 s → 4 s → ... capped at 2 h per attempt — until the config endpoint returns successfully. Concurrent callers share the single in-flight retry, so e.g. two simultaneous startDelivery(...) calls only produce one retry loop.

        The session-start path gates on this: if the config can't be fetched, startDelivery(...) won't fire newSession at all. Backoff state is in-memory and resets on every app launch, so a fresh process always starts from the initial 1 s delay regardless of prior failures.

      • preloadAsync

         final Unit preloadAsync()

        Async variant — kicks off the retry loop but doesn't suspend the caller. Useful from init so the config is likely already loaded by the time the host calls startDelivery(...).