Esempio n. 1
0
 public bool WithinTimeRange(EventInStorage eventInStorage)
 {
     return StartMarker <= eventInStorage.GlobalSequence && eventInStorage.GlobalSequence <= EndMarker;
 }
Esempio n. 2
0
        private static EventInStorage readEventInStorage(IDataRecord reader, int startingOrdinal)
        {
            const int eventIdOrdinal = 0;
            const int streamIdOrdinal = 1;
            const int contextNameOrdinal = 2;
            const int sequenceOrdinal = 3;
            const int globalSequenceOrdinal = 4;
            const int timestampOrdinal = 5;
            const int eventTypeOrdinal = 6;
            const int headerOrdinal = 7;
            const int bodyOrdinal = 8;

            var eventId = reader.GetGuid(eventIdOrdinal + startingOrdinal);
            var stream = reader.GetString(streamIdOrdinal + startingOrdinal);
            var contextName = reader.GetString(contextNameOrdinal + startingOrdinal);
            var sequence = (long)reader.GetValue(sequenceOrdinal + startingOrdinal);
            var globalSequence = (long)reader.GetValue(globalSequenceOrdinal + startingOrdinal);
            var timestamp = reader.GetDateTime(timestampOrdinal + startingOrdinal);
            var typeKey = reader.GetString(eventTypeOrdinal + startingOrdinal);
            var header = reader[headerOrdinal + startingOrdinal] as string;
            var body = reader.GetString(bodyOrdinal + startingOrdinal);

            var @event = new EventInStorage(eventId, contextName, stream, sequence, globalSequence, timestamp, typeKey,
                header, body);

            return @event;
        }
Esempio n. 3
0
 public void SignalResult(EventInStorage eventInStorage)
 {
     _task.TrySetResult(eventInStorage);
 }