@SuppressWarnings("unchecked")
 @Override
 protected <E extends Event<?>> Task<E> createTask() {
   long l = ringBuffer.next();
   RingBufferTask<?> t = ringBuffer.get(l);
   t.setSequenceId(l);
   return (Task<E>) t;
 }
 @Override
 public void onEvent(RingBufferTask<?> t, long sequence, boolean endOfBatch) throws Exception {
   t.execute();
 }