Class ImmediateResolutionStrategy

  • All Implemented Interfaces:

    
    public final class ImmediateResolutionStrategy
    extends PingResolutionStrategy
                        

    A PingResolutionStrategy that attempts to resolve (send) pings immediately upon request. This strategy is typically used for high-priority pings.

    Persistence order matters: the ping is persisted with status = IN_PROGRESS before the network attempt. This is the crash-recovery invariant that PingsDao.resetStaleStatus (called on PingComponent.start) and PingsDao.getUnExecutedFreshPings (strict-< on createdAt) rely on — if the process dies mid-flight, the row is re-IDLE'd on next boot and excluded from the fresh-recovery scan in the meantime.

    If the send is successful, the ping is removed. If it fails, the retry count is incremented. If the retry count exceeds the configured maximum, the ping is removed. A duplicate ping is not persisted, but still gets one immediate network attempt; its result is reported without removing or updating the existing row with the same ID. Listeners are notified of the outcome.