コード例 #1
0
        /// <summary>
        /// Publishes an event to the ring buffer.  It handles
        /// claiming the next sequence, getting the current (uninitialized)
        /// event from the ring buffer and publishing the claimed sequence
        /// after translation.
        /// </summary>
        /// <param name="translator">The user specified translation for the event</param>
        public void PublishEvent(Func <T, long, T> translator)
        {
            long sequence = _ringBuffer.Next();

            TranslateAndPublish(translator, sequence);
        }