-
public interface IOperationRepoThe operation queue provides a mechanism to queue one or more Operation with the promise it will be executed in a background thread at some point in the future. Operations are automatically persisted to disk in the event of an application being killed, and will be re-queued when the app is started up again.
-
-
Method Summary
Modifier and Type Method Description abstract Unitenqueue(Operation operation, Boolean flush)Enqueue an operation onto the operation repo. BooleanenqueueAndWait(Operation operation, Boolean flush)Enqueue an operation onto the operation repo and "wait" until the operation has been executed. abstract OperationWaitResultenqueueAndAwaitResult(Operation operation, Boolean flush)Same as enqueueAndWait, plus the HTTP status and body when the executor recorded a backend failure. abstract <T extends Operation> BooleancontainsInstanceOf(KClass<T> type)Check if the queue contains a specific operation type abstract UnitawaitInitialized()abstract UnitforceExecuteOperations()-
-
Method Detail
-
enqueue
abstract Unit enqueue(Operation operation, Boolean flush)
Enqueue an operation onto the operation repo.
- Parameters:
operation- The operation that should be executed.flush- Whether to force-flush the operation queue.
-
enqueueAndWait
Boolean enqueueAndWait(Operation operation, Boolean flush)
Enqueue an operation onto the operation repo and "wait" until the operation has been executed.
- Parameters:
operation- The operation that should be executed.flush- Whether to force-flush the operation queue.
-
enqueueAndAwaitResult
abstract OperationWaitResult enqueueAndAwaitResult(Operation operation, Boolean flush)
Same as enqueueAndWait, plus the HTTP status and body when the executor recorded a backend failure. Returns failure if the wait exceeds com.onesignal.core.internal.config.ConfigModel.opRepoAwaitTimeout.
-
containsInstanceOf
abstract <T extends Operation> Boolean containsInstanceOf(KClass<T> type)
Check if the queue contains a specific operation type
-
awaitInitialized
abstract Unit awaitInitialized()
-
forceExecuteOperations
abstract Unit forceExecuteOperations()
-
-
-
-