reactor.core.publisher.Operators.scalarSubscription()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中reactor.core.publisher.Operators.scalarSubscription()方法的一些代码示例,展示了Operators.scalarSubscription()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Operators.scalarSubscription()方法的具体详情如下:
包路径:reactor.core.publisher.Operators
类名称:Operators
方法名:scalarSubscription

Operators.scalarSubscription介绍

[英]Represents a fuseable Subscription that emits a single constant value synchronously to a Subscriber or consumer.
[中]表示同步向订阅者或使用者发送单个常量值的可融合订阅。

代码示例

代码示例来源:origin: reactor/reactor-core

@Override
public void subscribe(CoreSubscriber<? super T> actual) {
  actual.onSubscribe(Operators.scalarSubscription(actual, value));
}

代码示例来源:origin: reactor/reactor-core

@SuppressWarnings("unchecked")
public void subscribe(CoreSubscriber<? super Context> actual) {
  Context ctx = actual.currentContext();
  actual.onSubscribe(Operators.scalarSubscription(actual, ctx));
}

代码示例来源:origin: reactor/reactor-core

@Override
@SuppressWarnings("unchecked")
public void subscribe(CoreSubscriber<? super Integer> actual) {
  long st = start;
  long en = end;
  if (st == en) {
    Operators.complete(actual);
    return;
  } else
  if (st + 1 == en) {
    actual.onSubscribe(Operators.scalarSubscription(actual, (int)st));
    return;
  }
  
  if (actual instanceof ConditionalSubscriber) {
    actual.onSubscribe(new RangeSubscriptionConditional((ConditionalSubscriber<? super Integer>) actual, st, en));
    return;
  }
  actual.onSubscribe(new RangeSubscription(actual, st, en));
}

代码示例来源:origin: reactor/reactor-core

onSubscribeInner(Operators.scalarSubscription(actual, v));

代码示例来源:origin: reactor/reactor-core

onSubscribe(Operators.scalarSubscription(this, initialValue));
seedSubscriber =
    new ScanSeedSubscriber<>(this, accumulator, initialValue);

代码示例来源:origin: reactor/reactor-core

s.onSubscribe(Operators.scalarSubscription(s, v));

代码示例来源:origin: io.projectreactor/reactor-core

@Override
public void subscribe(CoreSubscriber<? super T> actual) {
  actual.onSubscribe(Operators.scalarSubscription(actual, value));
}

代码示例来源:origin: io.projectreactor/reactor-core

@SuppressWarnings("unchecked")
public void subscribe(CoreSubscriber<? super Context> actual) {
  Context ctx = actual.currentContext();
  actual.onSubscribe(Operators.scalarSubscription(actual, ctx));
}

代码示例来源:origin: io.projectreactor/reactor-core

@Override
@SuppressWarnings("unchecked")
public void subscribe(CoreSubscriber<? super Integer> actual) {
  long st = start;
  long en = end;
  if (st == en) {
    Operators.complete(actual);
    return;
  } else
  if (st + 1 == en) {
    actual.onSubscribe(Operators.scalarSubscription(actual, (int)st));
    return;
  }
  
  if (actual instanceof ConditionalSubscriber) {
    actual.onSubscribe(new RangeSubscriptionConditional((ConditionalSubscriber<? super Integer>) actual, st, en));
    return;
  }
  actual.onSubscribe(new RangeSubscription(actual, st, en));
}

代码示例来源:origin: io.projectreactor/reactor-core

onSubscribeInner(Operators.scalarSubscription(actual, v));

代码示例来源:origin: reactor/reactor-netty

innerActive = true;
inner.promise = promise;
inner.onSubscribe(Operators.scalarSubscription(inner, vr));

代码示例来源:origin: io.projectreactor.ipc/reactor-netty

innerActive = true;
inner.promise = promise;
inner.onSubscribe(Operators.scalarSubscription(inner, vr));

代码示例来源:origin: io.projectreactor.netty/reactor-netty

innerActive = true;
inner.promise = promise;
inner.onSubscribe(Operators.scalarSubscription(inner, vr));

代码示例来源:origin: io.projectreactor/reactor-core

onSubscribe(Operators.scalarSubscription(this, initialValue));
seedSubscriber =
    new ScanSeedSubscriber<>(this, accumulator, initialValue);

代码示例来源:origin: io.projectreactor/reactor-core

s.onSubscribe(Operators.scalarSubscription(s, v));

相关文章