Skip to content

Instantly share code, notes, and snippets.

@mdrabic
Created June 24, 2014 22:38
Show Gist options
  • Save mdrabic/a26e9fc1c54f01d8ee00 to your computer and use it in GitHub Desktop.
Save mdrabic/a26e9fc1c54f01d8ee00 to your computer and use it in GitHub Desktop.
rxjava worker thread example
final Scheduler.Worker worker = Schedulers.newThread().createWorker();
worker.schedule(new Action0() {
@Override
public void call() {
if (!mAnimationSet.isStarted()) {
removeViewAt(0);
worker.unsubscribe();
} else {
worker.schedule(this, 500, TimeUnit.MILLISECONDS);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment