Example #1
0
        public Task SubscribeToAllStreamsAsync(Action <RecordedEvent> eventAppeared, Action subscriptionDropped)
        {
            Ensure.NotNull(eventAppeared, "eventAppeared");
            Ensure.NotNull(subscriptionDropped, "subscriptionDropped");

            _subscriptionsChannel.EnsureConnected();
            return(_subscriptionsChannel.SubscribeToAllStreams(eventAppeared, subscriptionDropped));
        }
        public Task SubscribeToAllStreamsAsync(Action <RecordedEvent, Position> eventAppeared, Action subscriptionDropped)
        {
            Ensure.NotNull(eventAppeared, "eventAppeared");
            Ensure.NotNull(subscriptionDropped, "subscriptionDropped");
            EnsureActive();

            lock (_connectionLock)
                _subscriptionsChannel.EnsureConnected(_tcpEndPoint);
            return(_subscriptionsChannel.SubscribeToAllStreams(eventAppeared, subscriptionDropped));
        }