IRequestHelper

interface IRequestHelper

Request helper contract

Since

v1.3.0

Inheritors

Types

Link copied to clipboard
interface Listener

Listener interface to get notified by request status changes.

Functions

Link copied to clipboard

Adds a new listener that will be notified when any request changes Request.Status.

Link copied to clipboard
abstract suspend fun hasAnyWithStatus(status: Request.Status): Boolean

Check if request handler has any finished request with status

Link copied to clipboard
abstract suspend fun recordResult(wrapper: RequestWrapper, throwable: RequestError?)

Records the result of the result of a request

Link copied to clipboard

Removes the given listener from the listeners list.

Link copied to clipboard
abstract suspend fun retryWithStatus(status: Request.Status = Request.Status.FAILED, action: suspend () -> Unit): Boolean

Retries all request types for a given status.

Link copied to clipboard
abstract suspend fun runIfNotRunning(request: Request, handleCallback: suspend (RequestCallback) -> Unit): Boolean

Runs the given RequestCallback if no other requests in the given request type is already running. If run, the request will be run in the current thread.