org.reactivestreams.tck.SubscriberWhiteboxVerification Java Examples

The following examples show how to use org.reactivestreams.tck.SubscriberWhiteboxVerification. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProbeHandler.java    From aws-sdk-java-v2 with Apache License 2.0 4 votes vote down vote up
public ProbeHandler(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe, Class<T> clazz) {
    this.probe = probe;
    this.clazz = clazz;
}
 
Example #2
Source File: ProbeHandler.java    From netty-reactive-streams with Apache License 2.0 4 votes vote down vote up
public ProbeHandler(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe, Class<T> clazz) {
    this.probe = probe;
    this.clazz = clazz;
}
 
Example #3
Source File: TckWhiteBoxSubscriberTest.java    From cyclops with Apache License 2.0 4 votes vote down vote up
@Override
public Subscriber<Long> createSubscriber(
		org.reactivestreams.tck.SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<Long> probe) {

	 return new QueueBasedSubscriber<Long>(new QueueBasedSubscriber.Counter(),500) {
            @Override
            public void onSubscribe(final Subscription rsSubscription) {
               probe.registerOnSubscribe(new SubscriberPuppet() {
                      @Override
                      public void triggerRequest(long elements) {

                          rsSubscription.request(elements);
                      }

                      @Override
                      public void signalCancel() {
                          rsSubscription.cancel();
                      }
                  });
               super.onSubscribe(rsSubscription);
            }

            @Override
            public void onNext(Long aLong) {
                probe.registerOnNext(aLong);
                super.onNext(aLong);
            }

            @Override
            public void onError(Throwable t) {
                probe.registerOnError(t);
                super.onError(t);
            }

            @Override
            public void onComplete() {
                probe.registerOnComplete();
                super.onComplete();
            }
        };
    }