Created
October 9, 2015 06:20
-
-
Save xanderdunn/e7b00f3571ecf3300e88 to your computer and use it in GitHub Desktop.
Simples asynchronous RxScala example
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
Observable( | |
subscriber => { | |
new Thread(new Runnable() { | |
def run() { | |
val i = 0 // do real shit here instead | |
subscriber.onNext(i) | |
} | |
if (!subscriber.isUnsubscribed) { | |
subscriber.onCompleted() | |
} | |
} | |
}).start() | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment