private void TranslateAndPublish(IEventTranslatorVararg <T> translator, long sequence, params object[] args) { try { translator.TranslateTo(this[sequence], sequence, args); } finally { _fields.Sequencer.Publish(sequence); } }
private void TranslateAndPublishBatch(IEventTranslatorVararg <T> translator, int batchStartsAt, int batchSize, long finalSequence, object[][] args) { long initialSequence = finalSequence - (batchSize - 1); try { long sequence = initialSequence; int batchEndsAt = batchStartsAt + batchSize; for (int i = batchStartsAt; i < batchEndsAt; i++) { translator.TranslateTo(this[sequence], sequence++, args[i]); } } finally { _fields.Sequencer.Publish(initialSequence, finalSequence); } }