code: public void setValue(Object newValue) {
          synchronized (lock) {
              // Allow only once.
              if (ready) {
                  return;
              }
  
              result = newValue;
              ready = true;
              if (waiters > 0) {
                  lock.notifyAll();
              }
          }
  
          notifyListeners();
      }
docs: Sets the result of the asynchronous operation, and mark it as finished.