public void onData(ByteBuffer bb) {
   long sequence = ringBuffer.next(); // Grab the next sequence
   try {
     LongEvent event = ringBuffer.get(sequence); // Get the entry in the Disruptor for the sequence
     event.set(bb.getLong(0)); // Fill with data
   } finally {
     ringBuffer.publish(sequence);
   }
 }
Example #2
0
 public void onEvent(LongEvent longEvent, long l, boolean b) throws Exception {
   System.out.println(longEvent.getValue());
 }