Skip to content

//sorisdk/com.iplateia.sorisdk/PendingRequestManager/processPendingRequests

processPendingRequests

[androidJvm]
fun processPendingRequests(scope: CoroutineScope, onResult: (String, SORICampaign?) -> Unit)

Processes all pending requests in the queue.

This method should be called when network connectivity is restored. It will:

  1. Filter out expired requests (older than maxPendingTimeMillis)
  2. Attempt to retry each valid request using the API client
  3. Re-queue requests that fail again for future retry
  4. Invoke the callback for each processed request with the result

The processing happens asynchronously on the IO dispatcher to avoid blocking the main thread. The callback is invoked on the Main dispatcher.

Parameters

androidJvm

scopeThe coroutine scope to use for async processing
onResultCallback invoked for each processed request with materialId and resulting campaign (null if failed)

See also

SORIConfig.maxPendingTimeMillis
SORIConfig.enableDelayedSending