Class PingExecutor
-
- All Implemented Interfaces:
public abstract class PingExecutorAbstract base for the priority-specific ping executors. Concrete implementations (HighPriorityExecutor, NormalPriorityExecutor) process pings through runSlots, a fire-and-forget bounded-concurrency slot model that caps in-flight pings via a suspending kotlinx.coroutines.sync.Semaphore and marks rows IN_PROGRESS at dequeue. Results are delivered per-ping via ExecutorListener.onPingExecuted from inside each launched coroutine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPingExecutor.PingResultpublic interfacePingExecutor.ExecutorListenerCallback shape for per-ping completion. Invoked from inside runSlots for every ping that finishes via executeIsolated — both success and failure outcomes flow through here.
public enumPingExecutor.PingExecutorState
-
Constructor Summary
Constructors Constructor Description PingExecutor(PingsDao dao, PingExecutor.ExecutorListener listener, OkHttpPingNetworkHandler networkHandler)
-
Method Summary
-
-
Constructor Detail
-
PingExecutor
PingExecutor(PingsDao dao, PingExecutor.ExecutorListener listener, OkHttpPingNetworkHandler networkHandler)
-
-
Method Detail
-
onNewPing
final Unit onNewPing()
Notifies the executor that a new ping has been persisted. Three branches:
PingsV2 disabled in config → drop the wake-up.
Executor STOPPED → transition to STARTED and call startExecuting.
Executor STARTED → wake any idle/scheduled ping processing via resumePingProcessingIfIdle; in-flight ping processing is never cancelled, so this is safe to call at any time.
-
setState
final Unit setState(PingExecutor.PingExecutorState newState)
-
-
-
-