Operation

public interface Operation

androidx.work.Operation


Information about an operation being performed by WorkManager.

Summary

Nested classes

class Operation.State

The Operation state. 

Public methods

abstract ListenableFuture<Operation.State.SUCCESS> getResult()

Gets a ListenableFuture which will only resolve with a Operation.State.SUCCESS.

abstract LiveData<Operation.State> getState()

Gets a LiveData of the Operation Operation.State.

Public methods

getResult

public abstract ListenableFuture<Operation.State.SUCCESS> getResult ()

Gets a ListenableFuture which will only resolve with a Operation.State.SUCCESS. FAILURE Operation's will come through as a Throwable on the ListenableFuture.

Call Future.get() to block until the Operation reaches a terminal state.

Returns
ListenableFuture<Operation.State.SUCCESS> a ListenableFuture with information about Operation's Operation.State.SUCCESS state.

getState

public abstract LiveData<Operation.State> getState ()

Gets a LiveData of the Operation Operation.State.

Returns
LiveData<Operation.State> A LiveData of the Operation Operation.State.