コード例 #1
0
 protected override Task OnStart(string fromCheckpoint)
 {
     _eventStoreClient.Subscribe(fromCheckpoint,
                                 async commit =>
     {
         foreach (var eventMessage in commit.Events)
         {
             //await Dispatch(commit.StreamId, eventMessage.Headers[])
         }
     });
     return(Task.FromResult(0));
 }
        public void Start()
        {
            _subscription = _client.Subscribe(null, commit =>
            {
                var attempt = new CommitAttempt(commit.BucketId, commit.StreamId, commit.StreamRevision, commit.CommitId,
                                                commit.CommitSequence, commit.CommitStamp, commit.Headers, commit.Events)
                {
                    Headers =
                    {
                        { "CheckpointToken", commit.CheckpointToken }
                    }
                };

                return(_mirror.Advanced.Commit(attempt));
            });
        }