public void cancel() {
    if (mState.compareAndSet(STATE_CREATED, STATE_CANCELLED)) {
      onCancellation();
    }
  }
Abstraction for computation.

<p>Computation expressed as StatefulRunnable can be cancelled, but only if it has not started
yet.

<p>For better decoupling of the code computing the result and the code that handles it, 4
separate methods are provided: getResult, onSuccess, onFailure and onCancellation.

<p>This runnable can be run only once. Subsequent calls to run method won't have any effect.
fbcore/src/main/java/com/facebook/common/executors/StatefulRunnable.java