Skip to content

Instantly share code, notes, and snippets.

@xanderdunn
Created October 9, 2015 06:20
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 xanderdunn/e7b00f3571ecf3300e88 to your computer and use it in GitHub Desktop.
Save xanderdunn/e7b00f3571ecf3300e88 to your computer and use it in GitHub Desktop.
Simples asynchronous RxScala example
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