Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Created January 16, 2014 14:36
Show Gist options
  • Save ashkrit/8455960 to your computer and use it in GitHub Desktop.
Save ashkrit/8455960 to your computer and use it in GitHub Desktop.
// - Single mesage take
while((e = queue.take)!=null)
{
process(e)
}
/Multiple Message - Batch processing
while((e = queue.take)!=null)
{
queue.drainTo(elements);
process(e);
process(elements);
elements.clear();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment