Last active
December 9, 2017 05:27
-
-
Save shazin/82059f6661edefdc12aef569e9cf709d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find All, Subscribe, Be Active until disposed or completed. | |
Disposable subscription = taxiRepository.findWithTailableCursorBy() | |
.doOnNext(System.out::println) | |
.doOnComplete(() -> System.out.println("Finished")) | |
.doOnTerminate(() -> System.out.println("Terminated")) | |
.subscribe(); | |
Thread.sleep(1000); | |
taxiRepository.save(new Taxi(UUID.randomUUID().toString(), "ABC-1234", 4)).subscribe(); | |
Thread.sleep(100); | |
taxiRepository.save(new Taxi(UUID.randomUUID().toString(), "XYZ-1234", 4)).subscribe(); | |
Thread.sleep(1000); | |
subscription.dispose(); | |
taxiRepository.save(new Taxi(UUID.randomUUID().toString(), "DEF-1234", 4)).subscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment