Skip to content

Instantly share code, notes, and snippets.

@praseodym
Last active October 7, 2016 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save praseodym/b083e9c9e0b83b37a2a38cf97962809e to your computer and use it in GitHub Desktop.
Save praseodym/b083e9c9e0b83b37a2a38cf97962809e to your computer and use it in GitHub Desktop.
Flux.sample() behaviour in reactor-core 3.0.2.RELEASE
package io.pivotal.literx;
import org.junit.Test;
import reactor.core.publisher.Flux;
public class Sample {
@Test
public void sample() {
Flux<Integer> flux = Flux.just(1, 2, 3);
flux.log().sampleMillis(1000).subscribe(a -> System.out.println("Subscribe: " + a));
System.out.println("Done");
}
}
21:21:27.012 [main] DEBUG reactor.util.Loggers$LoggerFactory - Using Slf4j logging framework
21:21:27.073 [main] INFO reactor.Flux.Array.1 - | onSubscribe(reactor.core.publisher.FluxArray$ArraySubscription@2b9627bc)
21:21:27.076 [main] INFO reactor.Flux.Array.1 - | request(unbounded)
21:21:27.076 [main] INFO reactor.Flux.Array.1 - | onNext(1)
21:21:27.076 [main] INFO reactor.Flux.Array.1 - | onNext(2)
21:21:27.076 [main] INFO reactor.Flux.Array.1 - | onNext(3)
21:21:27.077 [main] INFO reactor.Flux.Array.1 - | onComplete()
Done
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment