本文整理了Java中cyclops.reactive.ReactiveSeq.jitter
方法的一些代码示例,展示了ReactiveSeq.jitter
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.jitter
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称:ReactiveSeq
方法名:jitter
[英]Introduce a random jitter / time delay between the emission of elements
{ @code
SimpleTimer timer = new SimpleTimer();
ReactiveSeq.of(1, 2, 3, 4, 5, 6)
.jitter(10000)
.collect(CyclopsCollectors.toList());
assertThat(timer.getElapsedNanoseconds(), greaterThan(20000l));
}
[中]在元素发射之间引入随机抖动/时间延迟
{ @code
SimpleTimer timer = new SimpleTimer();
ReactiveSeq.of(1, 2, 3, 4, 5, 6)
.jitter(10000)
.collect(CyclopsCollectors.toList());
assertThat(timer.getElapsedNanoseconds(), greaterThan(20000l));
}
代码示例来源:origin: aol/cyclops
/**
* Introduce a random jitter / time delay between the emission of elements
* <pre>
* {@code
* SimpleTimer timer = new SimpleTimer();
assertThat(Streamable.of(1,2,3,4,5,6)
.jitter(10000)
.collect(CyclopsCollectors.toList())
.size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
* }
* </pre>
* @param maxJitterPeriodInNanos - random number less than this is used for each jitter
* @return Sequence with a random jitter between element emission
*/
default Streamable<T> jitter(final long maxJitterPeriodInNanos) {
return fromStream(this.stream().jitter(maxJitterPeriodInNanos));
}
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).to(Streamable::fromStream).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void judder(){
SimpleTimer timer = new SimpleTimer();
assertThat(of(1,2,3,4,5,6).jitter(10000).collect(Collectors.toList()).size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
fromIntStream(IntStream.range(0, 1000))
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
Spouts.range(0, 1000)
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
Spouts.range(0, 1000)
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
Spouts.range(0, 1000)
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
Spouts.range(0, 1000)
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: aol/cyclops
@Test
public void jitter() {
Spouts.range(0, 1000)
.map(it -> it * 100)
.jitter(100l)
.peek(System.out::println)
.forEach(a->{});
}
代码示例来源:origin: com.oath.cyclops/cyclops
/**
* Introduce a random jitter / time delay between the emission of elements
* <pre>
* {@code
* SimpleTimer timer = new SimpleTimer();
assertThat(Streamable.of(1,2,3,4,5,6)
.jitter(10000)
.collect(CyclopsCollectors.toList())
.size(),is(6));
assertThat(timer.getElapsedNanoseconds(),greaterThan(20000l));
* }
* </pre>
* @param maxJitterPeriodInNanos - random number less than this is used for each jitter
* @return Sequence with a random jitter between element emission
*/
default Streamable<T> jitter(final long maxJitterPeriodInNanos) {
return fromStream(this.stream().jitter(maxJitterPeriodInNanos));
}
内容来源于网络,如有侵权,请联系作者删除!