Beispiel #1
0
        public void OnAvailableImage(
            long correlationId,
            int streamId,
            int sessionId,
            long subscriptionRegistrationId,
            int subscriberPositionId,
            string logFileName,
            string sourceIdentity)
        {
            Subscription subscription = (Subscription)_resourceByRegIdMap[subscriptionRegistrationId];

            if (null != subscription && !subscription.ContainsImage(correlationId))
            {
                Image image = new Image(subscription, sessionId,
                                        new UnsafeBufferPosition(_counterValuesBuffer, subscriberPositionId),
                                        LogBuffers(correlationId, logFileName), _ctx.ErrorHandler(), sourceIdentity, correlationId);

                AvailableImageHandler handler = subscription.AvailableImageHandler();
                if (null != handler)
                {
                    try
                    {
                        handler(image);
                    }
                    catch (Exception ex)
                    {
                        HandleError(ex);
                    }
                }

                subscription.AddImage(image);
            }
        }