コード例 #1
0
        /// <summary>
        /// Reads up events up to the last one available. Pre-loads the projection from its cache,
        /// if available, to reduce the necessary work.
        /// </summary>
        public async Task InitializeAsync(CancellationToken cancel = default(CancellationToken))
        {
            var log = _log.Timestamped();

            await Catchup(_projection, Stream, cancel);

            // Start reading everything
            log?.Info("[ES init] catching up with stream.");
            await CatchUpAsync(cancel).ConfigureAwait(false);

            log?.Info("[ES init] DONE !");
        }