public final void complete(O value){
  Objects.requireNonNull(value);
  for (; ; ) {
    int s=getState();
    if (s == SDS_NO_REQUEST_HAS_VALUE || s == SDS_HAS_REQUEST_HAS_VALUE) {
      return;
    }
    if (s == SDS_HAS_REQUEST_NO_VALUE) {
      if (outputFused == OUTPUT_NO_VALUE) {
        setValue(value);
        outputFused=OUTPUT_HAS_VALUE;
      }
      Subscriber<? super O> a=downstream();
      a.onNext(value);
      if (getState() != SDS_HAS_REQUEST_HAS_VALUE) {
        a.onComplete();
      }
      return;
    }
    setValue(value);
    if (compareAndSetState(SDS_NO_REQUEST_NO_VALUE,SDS_NO_REQUEST_HAS_VALUE)) {
      return;
    }
  }
}

public final void complete ( O value ) { Objects . requireNonNull ( value ) ; for ( ; ; ) { int s = getState ( ) ; if ( s == SDS_NO_REQUEST_HAS_VALUE || s == SDS_HAS_REQUEST_HAS_VALUE ) { return ; } if ( s == SDS_HAS_REQUEST_NO_VALUE ) { if ( outputFused == OUTPUT_NO_VALUE ) { setValue ( value ) ; outputFused = OUTPUT_HAS_VALUE ; } Subscriber < ? super O > a = downstream ( ) ; a . onNext ( value ) ; if ( getState ( ) != SDS_HAS_REQUEST_HAS_VALUE ) { a . onComplete ( ) ; } return ; } setValue ( value ) ; if ( compareAndSetState ( SDS_NO_REQUEST_NO_VALUE , SDS_NO_REQUEST_HAS_VALUE ) ) { return ; } } }
tries to emit the value and complete the underlying subscriber or stores the value away until there is a request for it . < p > make sure this method is called at most once
