Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }