Esempio n. 1
0
 private void TranslateAndPublish <A>(IEventTranslatorOneArg <T, A> translator, long sequence, A arg0)
 {
     try
     {
         translator.TranslateTo(this[sequence], sequence, arg0);
     }
     finally
     {
         _fields.Sequencer.Publish(sequence);
     }
 }
Esempio n. 2
0
 private void TranslateAndPublish <TArg>(IEventTranslatorOneArg <TEvent, TArg> translator, long sequence, TArg arg)
 {
     try
     {
         translator.TranslateTo(Get(sequence), sequence, arg);
     }
     finally
     {
         Sequencer.Publish(sequence);
     }
 }
Esempio n. 3
0
        private void TranslateAndPublishBatch <A>(IEventTranslatorOneArg <T, A> translator, A[] arg0,
                                                  int batchStartsAt, int batchSize, long finalSequence)
        {
            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++, arg0[i]);
                }
            }
            finally
            {
                _fields.Sequencer.Publish(initialSequence, finalSequence);
            }
        }
Esempio n. 4
0
        private void TranslateAndPublishBatch <TArg>(
            IEventTranslatorOneArg <TEvent, TArg> translator,
            TArg[] arg0,
            int batchStartsAt,
            int batchSize,
            long finalSequence)
        {
            var initialSequence = finalSequence - (batchSize - 1);

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