Example #1
0
        public async Task ContinueAsync()
        {
            if (IsCompleted)
            {
                m_streamCursor = await m_openCursor(CurrentStreamVersion.Increment());
                m_readedEvents = null;
                return;
            }

            throw new InvalidOperationException("Reader is not in competed state.");
        }
Example #2
0
        public EventStreamReader(
            string streamName,
            IEventStreamCursor streamCursor,
            Func<StreamVersion, Task<IEventStreamCursor>> openCursor)
        {
            Require.NotEmpty(streamName, "streamName");
            Require.NotNull(streamCursor, "streamCursor");
            Require.NotNull(openCursor, "openCursor");

            m_streamName = streamName;
            m_streamCursor = streamCursor;
            m_openCursor = openCursor;
        }