Beispiel #1
0
 private void TranslateAndPublish(IEventTranslatorVarArg <TEvent> translator, long sequence, params object[] args)
 {
     try
     {
         translator.TranslateTo(Get(sequence), sequence, args);
     }
     finally
     {
         Sequencer.Publish(sequence);
     }
 }
Beispiel #2
0
        private void TranslateAndPublishBatch(
            IEventTranslatorVarArg <TEvent> translator, int batchStartsAt,
            int batchSize, long finalSequence, params object[][] args)
        {
            var initialSequence = finalSequence - (batchSize - 1);

            try
            {
                long sequence    = initialSequence;
                var  batchEndsAt = batchStartsAt + batchSize;
                for (int i = batchStartsAt; i < batchEndsAt; i++)
                {
                    translator.TranslateTo(Get(sequence), sequence++, args[i]);
                }
            }
            finally
            {
                Sequencer.Publish(initialSequence, finalSequence);
            }
        }