Exemplo n.º 1
0
 private void TranslateAndPublish(IEventTranslatorVararg <T> translator, long sequence, params object[] args)
 {
     try
     {
         translator.TranslateTo(this[sequence], sequence, args);
     }
     finally
     {
         _fields.Sequencer.Publish(sequence);
     }
 }
Exemplo n.º 2
0
        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);
            }
        }