示例#1
0
        internal void ReleasePublication(ExclusivePublication publication)
        {
            VerifyActive();

            ExclusivePublication publicationToRemove;

            _activeExclusivePublications.TryRemove(publication.RegistrationId, out publicationToRemove);

            if (publication == publicationToRemove)
            {
                LingerResource(publication.ManagedResource());
                AwaitResponse(_driverProxy.RemovePublication(publication.RegistrationId), null);
            }
        }
示例#2
0
        internal void ReleasePublication(ExclusivePublication publication)
        {
            if (_isClosed)
            {
                throw new InvalidOperationException("Aeron client is closed");
            }

            ExclusivePublication publicationToRemove;

            _activeExclusivePublications.TryRemove(publication.RegistrationId, out publicationToRemove);

            if (publication == publicationToRemove)
            {
                LingerResource(publication.ManagedResource());
                AwaitResponse(_driverProxy.RemovePublication(publication.RegistrationId), null);
            }
        }
示例#3
0
        public void OnNewExclusivePublication(
            long correlationId,
            long registrationid,
            int streamId,
            int sessionId,
            int publicationLimitId,
            string channel,
            string logFileName)
        {
            ExclusivePublication publication = new ExclusivePublication(
                this,
                channel,
                streamId,
                sessionId,
                new UnsafeBufferPosition(_counterValuesBuffer, publicationLimitId),
                _logBuffersFactory.Map(logFileName, MapMode.ReadWrite),
                registrationid,
                correlationId);

            _activeExclusivePublications[correlationId] = publication;
        }
示例#4
0
        public void OnNewExclusivePublication(
            long correlationId,
            long registrationId,
            int streamId,
            int sessionId,
            int publicationLimitId,
            int statusIndicatorId,
            string logFileName)
        {
            var publication = new ExclusivePublication(
                this,
                _stashedChannel,
                streamId,
                sessionId,
                new UnsafeBufferPosition(_counterValuesBuffer, publicationLimitId),
                statusIndicatorId,
                LogBuffers(registrationId, logFileName),
                registrationId,
                correlationId
                );

            _resourceByRegIdMap[correlationId] = publication;
        }
示例#5
0
 public PublicationManagedResource(ExclusivePublication publication)
 {
     _publication = publication;
 }