Skip to content

Instantly share code, notes, and snippets.

@ionoy
Last active December 25, 2015 21:09
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 ionoy/7040729 to your computer and use it in GitHub Desktop.
Save ionoy/7040729 to your computer and use it in GitHub Desktop.
queue.Enqueue(data)
producer.OnNext(true)
producer.ObserveOn(Scheduler.NewThread).Subscribe(_ => {
T res;
if(queue.TryDequeue(out res)) {
work(res);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment