当前位置: 首页>>代码示例>>C#>>正文


C# IEventStoreConnection.SubscribeToAllFrom方法代码示例

本文整理汇总了C#中IEventStoreConnection.SubscribeToAllFrom方法的典型用法代码示例。如果您正苦于以下问题:C# IEventStoreConnection.SubscribeToAllFrom方法的具体用法?C# IEventStoreConnection.SubscribeToAllFrom怎么用?C# IEventStoreConnection.SubscribeToAllFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEventStoreConnection的用法示例。


在下文中一共展示了IEventStoreConnection.SubscribeToAllFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConnectToEventstore

 private void ConnectToEventstore()
 {
     _latestPosition = Position.Start;
     _connection = EventStoreConnectionWrapper.Connect();
     _connection.Connected +=
         (sender, args) => _connection.SubscribeToAllFrom(_latestPosition, false, HandleEvent);
     Console.WriteLine("Indexing service started");
 }
开发者ID:jrgcubano,项目名称:CQRSShop,代码行数:8,代码来源:IndexingServie.cs

示例2: Start

        public void Start(IEventStoreConnection connection, IEnumerable<object> observers)
        {
            WireUpObservers(observers);
            var credentials = new UserCredentials(_applicationSettings.GesUserName, _applicationSettings.GesPassword);
            var lastCheckpoint = Position.Start;

            _subscription = connection.SubscribeToAllFrom(lastCheckpoint, false,
                EventAppeared,
                OnLiveProcessingStarted,
                OnSubscriptionDropped,
                credentials
                );
        }
开发者ID:ahmedomarjee,项目名称:ES-workshop,代码行数:13,代码来源:EventsDispatcher.cs

示例3: Start

        public void Start()
        {
            HasLoaded = false;
            _connection = EventStore.ClientAPI.EventStoreConnection.Create(_endpoint);
            var ct = _connection.ConnectAsync();
            ct.Wait();
            _checkPoint = Position.Start;
            if (string.IsNullOrEmpty(_streamName))
                _subscription = _connection.SubscribeToAllFrom(_checkPoint, false, EventAppeared, Live, SubscriptionDropped, _credentials);
            else
                _subscription = _connection.SubscribeToStreamFrom(_streamName, _lastEventNumber, true, EventAppeared, Live, SubscriptionDropped, _credentials);

        }
开发者ID:valeriob,项目名称:MyBudget,代码行数:13,代码来源:InMemoryProjection.cs

示例4: FromAll

        static void FromAll(IEventStoreConnection con, UserCredentials userCredentials)
        {
            var sub = con.SubscribeToAllFrom(Position.Start, true, Appeared, Live, Dropped, userCredentials);
            // sub.Start();

            var read = con.ReadAllEventsForward(Position.Start, 1000, true, userCredentials);
            var mre = new ManualResetEvent(false);
            mre.WaitOne(3000);

            var rgpsa = events.GroupBy(g => g.Event.EventId).ToList();
            int i = 0;
            var rgps = events.Select(s => new { s, position = i++ }).GroupBy(g => g.s.Event.EventId).ToList();
            var rgps2 = read.Events.Select(s => new { s, position = i++ }).GroupBy(g => g.s.Event.EventId).ToList();

            foreach (var r in rgps)
            {
                var values = r.ToArray();

            }
            Console.ReadLine();
        }
开发者ID:valeriob,项目名称:MyBudget,代码行数:21,代码来源:Program.cs

示例5: Start

 public void Start(string connectionName)
 {
     eventStoreConnection = eventStoreConnectionFactory.Create(connectionName);
     var lastProcessedPosition = mongoDbEventPositionRepository.Get();
     eventStoreConnection.SubscribeToAllFrom(lastProcessedPosition, false, (subs, re) => DispatchEvent(re.ToResolvedEventWrapper()));
 }
开发者ID:gabrielsimas,项目名称:ES-and-DDD,代码行数:6,代码来源:EventProcessor.cs


注:本文中的IEventStoreConnection.SubscribeToAllFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。