Example #1
0
        /// <summary>
        /// Get all undispatched commits.
        /// </summary>
        public IEnumerable <Commit> GetUndispatched()
        {
            var result = eventStore.GetUndispatched();

            statistics.IncrementQueryCount();

            return(result);
        }
Example #2
0
        /// <summary>
        /// Ensure any un-dispatched commits are processed before handling new commits.
        /// </summary>
        /// <remarks>
        /// The dispatcher must be started after the IoC container has been built to ensure that any <see cref="Lazy{T}"/> circular dependencies can be resolved.
        /// </remarks>
        public void EnsurePersistedCommitsDispatched()
        {
            if (!markDispatched)
            {
                return;
            }

            foreach (var commit in eventStore.GetUndispatched())
            {
                Log.Warn("Processing undispatched commit {0}", commit.Id);
                DispatchCommit(commit);
            }
        }