コード例 #1
0
        private async Task StoreChanges(string branchId, ConcurrentDictionary <IStream, int> changes)
        {
            var flow    = new ChangesFlow(_activeTimeline, changes);
            var streams = await _streamLocator.ListStreams(branchId);

            streams.Subscribe(flow.InputBlock.AsObserver());

            try
            {
                await flow.CompletionTask;
            }
            catch (Exception e)
            {
                _log.Errors.Add(e);
            }
        }
コード例 #2
0
        private async Task StoreChanges <T>(string branchId, ConcurrentDictionary <IStream, int> changes)
            where T : IEventSourced
        {
            var store = GetStore <T>();
            var flow  = new ChangesFlow(_activeTimeline, changes);

            store.ListStreams(branchId).Subscribe(flow.InputBlock.AsObserver());

            try
            {
                await flow.CompletionTask;
            }
            catch (Exception e)
            {
                _log.Errors.Add(e);
            }
        }