jdk/src/java.base/share/classes/java/util/concurrent/Flow.java
changeset 46146 b3e220a04d3f
parent 44125 dbd27e1dfe6f
equal deleted inserted replaced
46145:1a5028372b29 46146:b3e220a04d3f
    83  *                         ExecutorService executor) {
    83  *                         ExecutorService executor) {
    84  *       this.subscriber = subscriber;
    84  *       this.subscriber = subscriber;
    85  *       this.executor = executor;
    85  *       this.executor = executor;
    86  *     }
    86  *     }
    87  *     public synchronized void request(long n) {
    87  *     public synchronized void request(long n) {
    88  *       if (n != 0 && !completed) {
    88  *       if (!completed) {
    89  *         completed = true;
    89  *         completed = true;
    90  *         if (n < 0) {
    90  *         if (n <= 0) {
    91  *           IllegalArgumentException ex = new IllegalArgumentException();
    91  *           IllegalArgumentException ex = new IllegalArgumentException();
    92  *           executor.execute(() -> subscriber.onError(ex));
    92  *           executor.execute(() -> subscriber.onError(ex));
    93  *         } else {
    93  *         } else {
    94  *           future = executor.submit(() -> {
    94  *           future = executor.submit(() -> {
    95  *             subscriber.onNext(Boolean.TRUE);
    95  *             subscriber.onNext(Boolean.TRUE);