public Task SubscribeAsync(string stream, Action <RecordedEvent> eventAppeared, Action subscriptionDropped) { Ensure.NotNullOrEmpty(stream, "stream"); Ensure.NotNull(eventAppeared, "eventAppeared"); Ensure.NotNull(subscriptionDropped, "subscriptionDropped"); _subscriptionsChannel.EnsureConnected(); return(_subscriptionsChannel.Subscribe(stream, eventAppeared, subscriptionDropped)); }
public Task SubscribeAsync(string stream, Action <RecordedEvent, Position> eventAppeared, Action subscriptionDropped) { Ensure.NotNullOrEmpty(stream, "stream"); Ensure.NotNull(eventAppeared, "eventAppeared"); Ensure.NotNull(subscriptionDropped, "subscriptionDropped"); EnsureActive(); lock (_connectionLock) _subscriptionsChannel.EnsureConnected(_tcpEndPoint); return(_subscriptionsChannel.Subscribe(stream, eventAppeared, subscriptionDropped)); }