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

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

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

Operators.as介绍

[英]Returns the subscription as QueueSubscription if possible or null.
[中]如果可能,将订阅返回为QueueSubscription或null。

代码示例

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

@SuppressWarnings("unchecked")
@Override
public void onSubscribe(Subscription s) {
  this.s = s;
  this.queueSubscription =
      Operators.as(s); //will set it to null if not Fuseable
  actual.onSubscribe(this);
}

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

@Override
public int requestFusion(int requestedMode) {
  QueueSubscription<T> qs = Operators.as(s);
  if (qs != null) {
    this.qs = qs;
    return qs.requestFusion(requestedMode);
  }
  return Fuseable.NONE;
}

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

@Override
final public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = s;
    this.qs = Operators.as(s);
    actual.onSubscribe(this);
  }
}

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

@Override
public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = s;
    this.qs = Operators.as(s);
    actual.onSubscribe(this);
  }
}

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

@SuppressWarnings("unchecked")
@Override
public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = Operators.as(s);
    actual.onSubscribe(this);
  }
}

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

@Override
public void onSubscribe(Subscription s) {
  this.qs = Operators.as(s);
  actual.onSubscribe(this);
}

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

@Test
public void castAsQueueSubscription() {
  Fuseable.QueueSubscription<String> qs = new Fuseable.SynchronousSubscription<String>() {
    @Override
    public String poll() {
      return null;
    }
    @Override
    public int size() {
      return 0;
    }
    @Override
    public boolean isEmpty() {
      return false;
    }
    @Override
    public void clear() {
    }
    @Override
    public void request(long n) {
    }
    @Override
    public void cancel() {
    }
  };
  Subscription s = Operators.cancelledSubscription();
  assertThat(Operators.as(qs)).isEqualTo(qs);
  assertThat(Operators.as(s)).isNull();
}

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

@SuppressWarnings("unchecked")
@Override
public void onSubscribe(Subscription s) {
  this.s = s;
  this.queueSubscription =
      Operators.as(s); //will set it to null if not Fuseable
  actual.onSubscribe(this);
}

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

@Override
public int requestFusion(int requestedMode) {
  QueueSubscription<T> qs = Operators.as(s);
  if (qs != null) {
    this.qs = qs;
    return qs.requestFusion(requestedMode);
  }
  return Fuseable.NONE;
}

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

@Override
public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = s;
    this.qs = Operators.as(s);
    actual.onSubscribe(this);
  }
}

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

@Override
final public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = s;
    this.qs = Operators.as(s);
    actual.onSubscribe(this);
  }
}

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

@SuppressWarnings("unchecked")
@Override
public void onSubscribe(Subscription s) {
  if (Operators.validate(this.s, s)) {
    this.s = Operators.as(s);
    actual.onSubscribe(this);
  }
}

相关文章