Skip to content

Instantly share code, notes, and snippets.

@mikeb01
Created December 31, 2011 14:29
Show Gist options
  • Save mikeb01/1544133 to your computer and use it in GitHub Desktop.
Save mikeb01/1544133 to your computer and use it in GitHub Desktop.
public void serialisePublishing(final long sequence,
final Sequence cursor,
final int batchSize) {
final long expectedSequence = sequence - batchSize;
while (expectedSequence != cursor.get()) {
// busy spin
}
cursor.set(sequence);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment