• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SubscriberWhiteboxVerification类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.reactivestreams.tck.SubscriberWhiteboxVerification的典型用法代码示例。如果您正苦于以下问题:Java SubscriberWhiteboxVerification类的具体用法?Java SubscriberWhiteboxVerification怎么用?Java SubscriberWhiteboxVerification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SubscriberWhiteboxVerification类属于org.reactivestreams.tck包,在下文中一共展示了SubscriberWhiteboxVerification类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createSubscriber

点赞 2

import org.reactivestreams.tck.SubscriberWhiteboxVerification; //导入依赖的package包/类
@Override
public Subscriber<Model> createSubscriber(
		org.reactivestreams.tck.SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<Model> probe) {
	return new SimpleSubscriber<Model>() {
		@Override
		public void onSubscribe(final Subscription s) {
			super.onSubscribe(s);

			probe.registerOnSubscribe(new SubscriberPuppet() {
				@Override
				public void triggerRequest(long elements) {
					s.request(elements);
				}

				@Override
				public void signalCancel() {
					s.cancel();
				}
			});
		}

		@Override
		public void onNext(Model element) {
			super.onNext(element);
			probe.registerOnNext(element);
		}

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

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

	};
}
 

开发者ID:bassemZohdy,
项目名称:simple-reactive-streams,
代码行数:42,
代码来源:SimpleSubscriberWhiteboxTest.java

示例2: ProbeHandler

点赞 2

import org.reactivestreams.tck.SubscriberWhiteboxVerification; //导入依赖的package包/类
public ProbeHandler(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe, Class<T> clazz) {
    this.probe = probe;
    this.clazz = clazz;
}
 

开发者ID:playframework,
项目名称:netty-reactive-streams,
代码行数:5,
代码来源:ProbeHandler.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)