本文整理汇总了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);
}
示例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);
}
示例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;
}
示例4: currentContext
import reactor.core.CoreSubscriber; //导入方法依赖的package包/类
@Override
public Context currentContext() {
CoreSubscriber<? super T> actual = this.actual;
return actual != null ? actual.currentContext() : Context.empty();
}
示例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));
}