Пример #1
0
        private EventStreamCursor(EventStreamHeader streamHeader, StreamVersion fromVersion, FetchEvents fetch)
        {
            Require.NotNull(fetch, "fetch");

            m_state = new InitialCursorState(streamHeader, fromVersion, fetch);
            m_slice = EventStreamSlice.Empty;
            m_cursorStreamVersion = fromVersion;
        }
Пример #2
0
        public EventStreamCursor(EventStreamPosition position, StreamVersion fromVersion, FetchEvents fetch)
        {
            Require.NotNull(fetch, "fetch");

            if (EventStreamPosition.IsNewStream(position))
            {
                m_state = new EndOfStreamCursorState();
                m_slice = EventStreamSlice.Empty;
            }
            else
            {
                m_state = new InitialCursorState(position, fromVersion, fetch);
            }
        }
Пример #3
0
 public async Task FetchSlice()
 {
     m_slice = await m_state.FetchSlice();
     m_state = m_state.NextState;
 }
Пример #4
0
        public async Task FetchSlice()
        {
            m_slice = await m_state.FetchSlice();

            m_state = m_state.NextState;
        }
Пример #5
0
 private EventStreamCursor()
 {
     m_state = new EndOfStreamCursorState(EventStreamHeader.Unknown);
     m_slice = EventStreamSlice.Empty;
 }
Пример #6
0
 private EventStreamCursor(EventStreamHeader streamHeader, StreamVersion fromVersion)
 {
     m_state = new EndOfStreamCursorState(streamHeader);
     m_slice = EventStreamSlice.Empty;
     m_cursorStreamVersion = fromVersion;
 }
Пример #7
0
        public static bool IsEndOfStream(CursorState state)
        {
            Require.NotNull(state, "state");

            return state is EndOfStreamCursorState;
        }
Пример #8
0
        public static bool IsFetching(CursorState state)
        {
            Require.NotNull(state, "state");

            return state is FetchingCursorState;
        }
Пример #9
0
        public static bool IsInitialState(CursorState state)
        {
            Require.NotNull(state, "state");

            return state is InitialCursorState;
        }
Пример #10
0
        public static bool IsFetching(CursorState state)
        {
            Require.NotNull(state, "state");

            return(state is FetchingCursorState);
        }
Пример #11
0
        public static bool IsInitialState(CursorState state)
        {
            Require.NotNull(state, "state");

            return(state is InitialCursorState);
        }
Пример #12
0
        public static bool IsEndOfStream(CursorState state)
        {
            Require.NotNull(state, "state");

            return(state is EndOfStreamCursorState);
        }