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

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

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

Flux.skipLast介绍

[英]Skip a specified number of elements at the end of this Flux sequence.
[中]在此通量序列末尾跳过指定数量的元素。

代码示例

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

@Override
protected List<Scenario<String, String>> scenarios_errorFromUpstreamFailure() {
  return Arrays.asList(scenario(f -> f.skipLast(1)));
}

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

@Test(expected = IllegalArgumentException.class)
public void negativeNumber() {
  Flux.never()
    .skipLast(-1);
}

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

@Override
protected List<Scenario<String, String>> scenarios_operatorSuccess() {
  return Arrays.asList(
      scenario(f -> f.skipLast(1))
          .receiveValues(item(0) ,item(1))
  );
}

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

@Test
public void skipAll() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create();
  Flux.range(1, 10)
    .skipLast(20)
    .subscribe(ts);
  ts.assertNoValues()
   .assertNoError()
   .assertComplete();
}

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

@Test
public void skipNone() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create();
  Flux.range(1, 10)
    .skipLast(0)
    .subscribe(ts);
  ts.assertValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
   .assertNoError()
   .assertComplete();
}

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

@Test
public void skipSome() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create();
  Flux.range(1, 10)
    .skipLast(3)
    .subscribe(ts);
  ts.assertValues(1, 2, 3, 4, 5, 6, 7)
   .assertNoError()
   .assertComplete();
}

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

@Test
public void skipAllBackpressured() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
  Flux.range(1, 10)
    .skipLast(20)
    .subscribe(ts);
  ts.assertNoValues()
   .assertNoError()
   .assertComplete();
}

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

@Test
public void skipSomeBackpressured() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
  Flux.range(1, 10)
    .skipLast(3)
    .subscribe(ts);
  ts.assertNoValues()
   .assertNotComplete()
   .assertNoError();
  ts.request(2);
  ts.assertValues(1, 2)
   .assertNotComplete()
   .assertNoError();
  ts.request(4);
  ts.assertValues(1, 2, 3, 4, 5, 6)
   .assertNotComplete()
   .assertNoError();
  ts.request(10);
  ts.assertValues(1, 2, 3, 4, 5, 6, 7)
   .assertNoError()
   .assertComplete();
}

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

@Test
public void skipNoneBackpressured() {
  AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
  Flux.range(1, 10)
    .skipLast(0)
    .subscribe(ts);
  ts.assertNoValues()
   .assertNotComplete()
   .assertNoError();
  ts.request(2);
  ts.assertValues(1, 2)
   .assertNotComplete()
   .assertNoError();
  ts.request(5);
  ts.assertValues(1, 2, 3, 4, 5, 6, 7)
   .assertNotComplete()
   .assertNoError();
  ts.request(10);
  ts.assertValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
   .assertNoError()
   .assertComplete();
}

代码示例来源:origin: com.aol.cyclops/cyclops-reactor

/**
 * @param n
 * @return
 * @see reactor.core.publisher.Flux#skipLast(int)
 */
public final Flux<T> skipLast(int n) {
  return boxed.skipLast(n);
}
/**

代码示例来源:origin: com.aol.cyclops/cyclops-reactor

@Override
public ReactiveSeq<T> skipLast(int num) {
  return flux(flux.skipLast(num));
}

相关文章

Flux类方法