本文整理汇总了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");
}
示例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
);
}
示例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);
}
示例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();
}
示例5: Start
public void Start(string connectionName)
{
eventStoreConnection = eventStoreConnectionFactory.Create(connectionName);
var lastProcessedPosition = mongoDbEventPositionRepository.Get();
eventStoreConnection.SubscribeToAllFrom(lastProcessedPosition, false, (subs, re) => DispatchEvent(re.ToResolvedEventWrapper()));
}