当前位置: 首页>>代码示例>>Java>>正文


Java CoreSubscriber.currentContext方法代码示例

本文整理汇总了Java中reactor.core.CoreSubscriber.currentContext方法的典型用法代码示例。如果您正苦于以下问题:Java CoreSubscriber.currentContext方法的具体用法?Java CoreSubscriber.currentContext怎么用?Java CoreSubscriber.currentContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reactor.core.CoreSubscriber的用法示例。


在下文中一共展示了CoreSubscriber.currentContext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: subscribe

import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
@Override
public void subscribe(CoreSubscriber<? super R> actual) {

	FluxPublishMulticast.FluxPublishMulticaster<T> multicast =
			new FluxPublishMulticast.FluxPublishMulticaster<>(Integer.MAX_VALUE,
					Queues.one(), actual.currentContext());

	Mono<? extends R> out;

	try {
		out = Objects.requireNonNull(transform.apply(fromDirect(multicast)),
				"The transform returned a null Mono");
	}
	catch (Throwable ex) {
		Operators.error(actual, Operators.onOperatorError(ex, actual.currentContext()));
		return;
	}

	if (out instanceof Fuseable) {
		out.subscribe(new FluxPublishMulticast.CancelFuseableMulticaster<>(actual, multicast));
	}
	else {
		out.subscribe(new FluxPublishMulticast.CancelMulticaster<>(actual, multicast));
	}

	source.subscribe(multicast);
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:28,代码来源:MonoPublishMulticast.java

示例2: subscribe

import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
@Override
public void subscribe(CoreSubscriber<? super R> actual) {

	FluxPublishMulticaster<T> multicast = new FluxPublishMulticaster<>(prefetch,
			queueSupplier,
			actual.currentContext());

	Publisher<? extends R> out;

	try {
		out = Objects.requireNonNull(transform.apply(multicast),
				"The transform returned a null Publisher");
	}
	catch (Throwable ex) {
		Operators.error(actual,
				Operators.onOperatorError(ex, actual.currentContext()));
		return;
	}

	if (out instanceof Fuseable) {
		out.subscribe(new CancelFuseableMulticaster<>(actual, multicast));
	}
	else {
		out.subscribe(new CancelMulticaster<>(actual, multicast));
	}

	source.subscribe(multicast);
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:29,代码来源:FluxPublishMulticast.java

示例3: DoOnEachSubscriber

import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
DoOnEachSubscriber(CoreSubscriber<? super T> actual,
		Consumer<? super Signal<T>> onSignal) {
	this.actual = actual;
	this.cachedContext = actual.currentContext();
	this.onSignal = onSignal;
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:7,代码来源:FluxDoOnEach.java

示例4: currentContext

import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
@Override
public Context currentContext() {
	CoreSubscriber<? super T> actual = this.actual;
	return actual != null ? actual.currentContext() : Context.empty();
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:6,代码来源:UnicastProcessor.java

示例5: subscribe

import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void subscribe(CoreSubscriber<? super Context> actual) {
	Context ctx = actual.currentContext();
	actual.onSubscribe(Operators.scalarSubscription(actual, ctx));
}
 
开发者ID:reactor,项目名称:reactor-core,代码行数:6,代码来源:MonoCurrentContext.java


注:本文中的reactor.core.CoreSubscriber.currentContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。