Skip to content

Instantly share code, notes, and snippets.

@mikeb01
Created April 28, 2015 03:39
Show Gist options
  • Save mikeb01/d1a7a338b151b400a4bc to your computer and use it in GitHub Desktop.
Save mikeb01/d1a7a338b151b400a4bc to your computer and use it in GitHub Desktop.
RingBuffer<ValueEvent<String>> ringBuffer = new RingBuffer<>(...);
String data = "ABC";
long next = ringBuffer.next();
try
{
ValueEvent<String> event = ringBuffer.get(next);
event.set(data);
}
finally
{
ringBuffer.publish(next);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment