Beispiel #1
0
        internal virtual void ReleaseSubscription(Subscription subscription)
        {
            VerifyActive();

            AwaitResponse(_driverProxy.RemoveSubscription(subscription.RegistrationId), null);

            _activeSubscriptions.Remove(subscription);
        }
Beispiel #2
0
        internal virtual void ReleaseSubscription(Subscription subscription)
        {
            if (_isClosed)
            {
                throw new InvalidOperationException("Aeron client is closed");
            }

            AwaitResponse(_driverProxy.RemoveSubscription(subscription.RegistrationId), null);

            _activeSubscriptions.Remove(subscription);
        }
Beispiel #3
0
        internal void ReleaseSubscription(Subscription subscription)
        {
            _clientLock.Lock();
            try
            {
                if (_isTerminating || _isClosed)
                {
                    return;
                }

                if (!subscription.IsClosed)
                {
                    EnsureNotReentrant();

                    subscription.InternalClose();

                    long registrationId = subscription.RegistrationId;
                    var  resource       = _resourceByRegIdMap[registrationId];
                    _resourceByRegIdMap.Remove(registrationId);

                    if (subscription == resource)
                    {
                        _asyncCommandIdSet.Add(_driverProxy.RemoveSubscription(registrationId));
                    }
                }
            }
            finally
            {
                _clientLock.Unlock();
            }
        }
Beispiel #4
0
        internal virtual void ReleaseSubscription(Subscription subscription)
        {
            lock (this)
            {
                VerifyDriverIsActive();

                var correlationId = _driverProxy.RemoveSubscription(subscription.RegistrationId);
                var timeout       = _nanoClock.NanoTime() + _driverTimeoutNs;

                DoWorkUntil(correlationId, timeout, subscription.Channel);

                _activeSubscriptions.Remove(subscription);
            }
        }
Beispiel #5
0
        internal void ReleaseSubscription(Subscription subscription)
#endif
        {
            lock (this)
            {
                VerifyDriverIsActive();

                var correlationId = _driverProxy.RemoveSubscription(subscription.RegistrationId);

                AwaitResponse(correlationId, subscription.Channel, false);

                _activeSubscriptions.Remove(subscription);
            }
        }
Beispiel #6
0
        internal virtual void ReleaseSubscription(Subscription subscription)
        {
            _clientLock.Lock();
            try
            {
                if (!subscription.Closed)
                {
                    subscription.InternalClose();

                    EnsureOpen();

                    long registrationId = subscription.RegistrationId;
                    AwaitResponse(_driverProxy.RemoveSubscription(registrationId));
                    _resourceByRegIdMap.Remove(registrationId);
                }
            }
            finally
            {
                _clientLock.Unlock();
            }
        }