Example #1
0
        void BindFlow(TimelinePosition position)
        {
            _flow = ReadData();

            FlowContext.Bind(_flow, _key, position, TimelinePosition.None);

            _areaCheckpoint = position.ToInt64();
        }
Example #2
0
        public async Task <TimelinePosition> WriteNewEvents(TimelinePosition cause, FlowKey topicKey, Many <Event> newEvents)
        {
            foreach (var newEvent in newEvents)
            {
                var(copy, type) = CopyEvent(newEvent);

                await OnNext(new TimelinePoint(
                                 AdvancePosition(),
                                 cause,
                                 type,
                                 copy.When,
                                 Event.Traits.WhenOccurs.Get(copy),
                                 Event.Traits.EventId.Get(copy),
                                 Event.Traits.CommandId.Get(copy),
                                 Event.Traits.UserId.Get(copy),
                                 topicKey,
                                 type.GetRoutes(copy).ToMany(),
                                 () => copy));
            }

            return(new TimelinePosition(_currentPosition.ToInt64() - newEvents.Count));
        }
Example #3
0
 public override string ToString() =>
 Checkpoint.IsNone ? Key.ToString() : $"{Key}@{Checkpoint.ToInt64()}";