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; }
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); } }
public async Task FetchSlice() { m_slice = await m_state.FetchSlice(); m_state = m_state.NextState; }
public async Task FetchSlice() { m_slice = await m_state.FetchSlice(); m_state = m_state.NextState; }
private EventStreamCursor() { m_state = new EndOfStreamCursorState(EventStreamHeader.Unknown); m_slice = EventStreamSlice.Empty; }
private EventStreamCursor(EventStreamHeader streamHeader, StreamVersion fromVersion) { m_state = new EndOfStreamCursorState(streamHeader); m_slice = EventStreamSlice.Empty; m_cursorStreamVersion = fromVersion; }
public static bool IsEndOfStream(CursorState state) { Require.NotNull(state, "state"); return state is EndOfStreamCursorState; }
public static bool IsFetching(CursorState state) { Require.NotNull(state, "state"); return state is FetchingCursorState; }
public static bool IsInitialState(CursorState state) { Require.NotNull(state, "state"); return state is InitialCursorState; }
public static bool IsFetching(CursorState state) { Require.NotNull(state, "state"); return(state is FetchingCursorState); }
public static bool IsInitialState(CursorState state) { Require.NotNull(state, "state"); return(state is InitialCursorState); }
public static bool IsEndOfStream(CursorState state) { Require.NotNull(state, "state"); return(state is EndOfStreamCursorState); }