Beispiel #1
0
        internal ClusteredServiceAgent(ClusteredServiceContainer.Context ctx)
        {
            this.ctx = ctx;

            archiveCtx           = ctx.ArchiveContext();
            aeron                = ctx.Aeron();
            shouldCloseResources = ctx.OwnsAeronClient();
            service              = ctx.ClusteredService();
            recordingLog         = ctx.RecordingLog();
            idleStrategy         = ctx.IdleStrategy();
            serviceId            = ctx.ServiceId();
            epochClock           = ctx.EpochClock();
            markFile             = ctx.MarkFile();


            var channel  = ctx.ServiceControlChannel();
            var streamId = ctx.ServiceControlStreamId();

            serviceControlPublisher = new ServiceControlPublisher(aeron.AddPublication(channel, streamId));
            serviceControlAdapter   = new ServiceControlAdapter(aeron.AddSubscription(channel, streamId), this);
        }