use of reactor.core.publisher.FluxSink.OverflowStrategy in project reactor-core by reactor.
the class FluxCreateTest method secondOnCancelHandlerIsDisposedImmediately.
@ParameterizedTestWithName
@EnumSource(OverflowStrategy.class)
void secondOnCancelHandlerIsDisposedImmediately(OverflowStrategy overflowStrategy) {
AtomicInteger firstDisposed = new AtomicInteger();
AtomicInteger secondDisposed = new AtomicInteger();
Flux.create(sink -> sink.onCancel(firstDisposed::incrementAndGet).onCancel(secondDisposed::incrementAndGet), overflowStrategy).subscribe();
assertThat(firstDisposed).as("first handler for %s", overflowStrategy).hasValue(0);
assertThat(secondDisposed).as("second handler for %s", overflowStrategy).hasValue(1);
}
use of reactor.core.publisher.FluxSink.OverflowStrategy in project reactor-core by reactor.
the class FluxCreateTest method secondOnDisposeHandlerIsDisposedImmediately.
@ParameterizedTestWithName
@EnumSource(OverflowStrategy.class)
void secondOnDisposeHandlerIsDisposedImmediately(OverflowStrategy overflowStrategy) {
AtomicInteger firstDisposed = new AtomicInteger();
AtomicInteger secondDisposed = new AtomicInteger();
Flux.create(sink -> sink.onDispose(firstDisposed::incrementAndGet).onDispose(secondDisposed::incrementAndGet), overflowStrategy).subscribe();
assertThat(firstDisposed).as("first handler for %s", overflowStrategy).hasValue(0);
assertThat(secondDisposed).as("second handler for %s", overflowStrategy).hasValue(1);
}
Aggregations