use of reactor.core.publisher.ParallelGroup.ParallelInnerGroup in project reactor-core by reactor.
the class ParallelGroupTest method scanInnerGroup.
@Test
public void scanInnerGroup() {
ParallelInnerGroup<Integer> test = new ParallelInnerGroup<>(1023);
CoreSubscriber<Integer> subscriber = new LambdaSubscriber<>(null, e -> {
}, null, sub -> sub.request(3));
Subscription s = Operators.emptySubscription();
test.onSubscribe(s);
test.subscribe(subscriber);
assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(s);
assertThat(test.scan(Scannable.Attr.ACTUAL)).isSameAs(subscriber);
// see other test for request
assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isZero();
assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse();
test.cancel();
assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();
}
use of reactor.core.publisher.ParallelGroup.ParallelInnerGroup in project reactor-core by reactor.
the class ParallelGroupTest method scanInnerGroupRequestNotTrackedWhenParent.
@Test
public void scanInnerGroupRequestNotTrackedWhenParent() {
ParallelInnerGroup<Integer> test = new ParallelInnerGroup<>(1023);
CoreSubscriber<Integer> subscriber = new LambdaSubscriber<>(null, e -> {
}, null, sub -> sub.request(3));
Subscription s = Operators.emptySubscription();
test.onSubscribe(s);
test.subscribe(subscriber);
assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isZero();
test.request(2);
assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isZero();
}
Aggregations