@Override public boolean cancel(boolean mayInterruptIfRunning) { if (isCancelled()) { return false; } this.processor.cancel(); // isCancelled may still return false, if mono completed before the cancel return this.processor.isCancelled(); }
@Override public boolean cancel(boolean mayInterruptIfRunning) { if (isCancelled()) { return false; } this.processor.cancel(); // isCancelled may still return false, if mono completed before the cancel return this.processor.isCancelled(); }
cancel(); throw new IllegalStateException("Timeout on Mono blocking read");
@Test public void scanProcessorCancelled() { MonoProcessor<String> test = MonoProcessor.create(); Subscription subscription = Operators.emptySubscription(); test.onSubscribe(subscription); assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(Integer.MAX_VALUE); assertThat(test.scan(Scannable.Attr.TERMINATED)).isFalse(); assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse(); test.cancel(); assertThat(test.scan(Scannable.Attr.TERMINATED)).isFalse(); assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue(); }
@Test public void cancel() { TestPublisher<String> cancelTester = TestPublisher.create(); MonoProcessor<Integer> processor = cancelTester.mono() .flatMap(s -> Mono.just(s.length())) .toProcessor(); processor.subscribe(); processor.cancel(); cancelTester.assertCancelled(); }
@Test public void cancel() { TestPublisher<String> cancelTester = TestPublisher.create(); MonoProcessor<Boolean> processor = cancelTester.flux() .any(s -> s.length() > 100) .toProcessor(); processor.subscribe(); processor.cancel(); cancelTester.assertCancelled(); }
@Override public void cancel() { processor.cancel(); }
@Test public void cancel() { TestPublisher<String> cancelTester = TestPublisher.create(); MonoProcessor<String> processor = cancelTester.flux() .next() .toProcessor(); processor.subscribe(); processor.cancel(); cancelTester.assertCancelled(); }
@Test public void cancel() { TestPublisher<String> cancelTester = TestPublisher.create(); MonoProcessor<String> processor = cancelTester.flux() .elementAt(1000) .toProcessor(); processor.subscribe(); processor.cancel(); cancelTester.assertCancelled(); }
@Test public void cancel() { TestPublisher<String> cancelTester = TestPublisher.create(); MonoProcessor<Void> processor = cancelTester.flux() .then() .toProcessor(); processor.subscribe(); processor.cancel(); cancelTester.assertCancelled(); }
@Override public void cancel() { processor.cancel(); }
@Override public boolean cancel(boolean mayInterruptIfRunning) { if (isCancelled()) { return false; } this.monoProcessor.cancel(); return true; }
@Override public boolean cancel(boolean mayInterruptIfRunning) { if (isCancelled()) { return false; } this.processor.cancel(); // isCancelled may still return false, if mono completed before the cancel return this.processor.isCancelled(); }
@Override public boolean cancel(boolean mayInterruptIfRunning) { if (isCancelled()) { return false; } this.processor.cancel(); // isCancelled may still return false, if mono completed before the cancel return this.processor.isCancelled(); }
cancel(); throw new IllegalStateException("Timeout on Mono blocking read");
void setRSocket(RSocket rSocket) { MonoProcessor<RSocket> _m; synchronized (this) { _m = currentSink; resetStatistics(); } _m.onNext(rSocket); _m.onComplete(); Disposable subscribe = onClose .doFinally( s -> { rSocket.dispose(); _m.cancel(); }) .subscribe(); rSocket .onClose() .doFinally( s -> { subscribe.dispose(); resetMono(); }) .subscribe(); }
void setRSocket(RSocket rSocket) { MonoProcessor<RSocket> _m; synchronized (this) { _m = currentSink; resetStatistics(); } _m.onNext(rSocket); _m.onComplete(); Disposable subscribe = onClose .doFinally( s -> { rSocket.dispose(); _m.cancel(); }) .subscribe(); rSocket .onClose() .doFinally( s -> { subscribe.dispose(); resetMono(); }) .subscribe(); }
void setRSocket(RSocket rSocket) { MonoProcessor<RSocket> _m; synchronized (this) { _m = currentSink; resetStatistics(); } _m.onNext(rSocket); _m.onComplete(); Disposable subscribe = onClose .doFinally( s -> { rSocket.dispose(); _m.cancel(); }) .subscribe(); rSocket .onClose() .doFinally( s -> { subscribe.dispose(); resetMono(); }) .subscribe(); }
sendOneFrame(Frame.Cancel.from(streamId)); if (subscribedRequests != null) { subscribedRequests.cancel();