Skip to content

Instantly share code, notes, and snippets.

@pyadav
Forked from mdrabic/sample.java
Created August 8, 2016 03:55
Show Gist options
  • Select an option

  • Save pyadav/0f573968f3febcf6ff4a30e02145244c to your computer and use it in GitHub Desktop.

Select an option

Save pyadav/0f573968f3febcf6ff4a30e02145244c 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