Class HighPriorityExecutor
-
- All Implemented Interfaces:
public final class HighPriorityExecutor extends PingExecutor
Executor for handling high-priority pings.
Runs two independent processing loops over disjoint sets, each capped at N =
maxBatchSize.highvia runSlots:one-time pending ping processing (processPendingHighPriorityPings) on the first run, which sends idle pings that were persisted before this process started (crash recovery), and
retry ping processing (processHighPriorityRetries) for FAILED pings whose
retryAfterhas elapsed.
Retry ping processing schedules itself after the configured interval while pings remain, and stops when the DB is empty. A new ping wakes a sleeping re-run immediately.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHighPriorityExecutor.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static HighPriorityExecutor.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description HighPriorityExecutor(PingsDao dao, PingExecutor.ExecutorListener listener, OkHttpPingNetworkHandler networkHandler)
-
Method Summary
Modifier and Type Method Description final UnitprocessPendingHighPriorityPings()Processes pending fresh high-priority pings (idle, retry_count=0) created before this run. final UnithandleResultInternal(PingExecutor.PingResult result)-
-
Constructor Detail
-
HighPriorityExecutor
HighPriorityExecutor(PingsDao dao, PingExecutor.ExecutorListener listener, OkHttpPingNetworkHandler networkHandler)
- Parameters:
dao- The PingsDao instance for database operations.listener- The ExecutorListener to be notified of ping execution results.
-
-
Method Detail
-
processPendingHighPriorityPings
final Unit processPendingHighPriorityPings()
Processes pending fresh high-priority pings (idle, retry_count=0) created before this run. Blind one-time crash-recovery scan: does NOT consult the network gate — offline failures become FAILED rows handled normally by processHighPriorityRetries. Does not schedule itself.
-
handleResultInternal
final Unit handleResultInternal(PingExecutor.PingResult result)
-
-
-
-