Last active
May 25, 2016 21:09
-
-
Save cypressious/28dbbc1a7adcfe844f134232c5a8e8f3 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
val mutex = Semaphore(0) | |
val source = Observable.interval(200, TimeUnit.MILLISECONDS).take(10) | |
val delayed = source.delayUntil(3L) | |
println("${System.currentTimeMillis()}: start") | |
delayed.subscribe( | |
{ println("${System.currentTimeMillis()}: $it") }, | |
{ println("Failed with $it") }, | |
{ mutex.release() } | |
) | |
mutex.acquire() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment