internal void Connect(Aeron.Aeron aeron) { if (null == _responsePublication) { _responsePublication = aeron.AddPublication(_responseChannel, _responseStreamId); } }
internal ClusteredServiceAgent(ClusteredServiceContainer.Context ctx) { this.ctx = ctx; archiveCtx = ctx.ArchiveContext(); aeron = ctx.Aeron(); service = ctx.ClusteredService(); idleStrategy = ctx.IdleStrategy(); serviceId = ctx.ServiceId(); epochClock = ctx.EpochClock(); markFile = ctx.MarkFile(); var channel = ctx.ServiceControlChannel(); _consensusModuleProxy = new ConsensusModuleProxy(aeron.AddPublication(channel, ctx.ConsensusModuleStreamId())); _serviceAdapter = new ServiceAdapter(aeron.AddSubscription(channel, ctx.ServiceStreamId()), this); UnsafeBuffer headerBuffer = new UnsafeBuffer(new byte[SESSION_HEADER_LENGTH]); _egressMessageHeaderEncoder.WrapAndApplyHeader(headerBuffer, 0, new MessageHeaderEncoder()); _vectors[0] = new DirectBufferVector(headerBuffer, 0, SESSION_HEADER_LENGTH); _vectors[1] = _messageVector; }
internal ClusteredServiceAgent(ClusteredServiceContainer.Context ctx) { this.ctx = ctx; headerVector = new DirectBufferVector(headerBuffer, 0, headerBuffer.Capacity); abortHandler = Abort; archiveCtx = ctx.ArchiveContext(); aeron = ctx.Aeron(); aeronAgentInvoker = ctx.Aeron().ConductorAgentInvoker; service = ctx.ClusteredService(); idleStrategy = ctx.IdleStrategy(); serviceId = ctx.ServiceId(); epochClock = ctx.EpochClock(); markFile = ctx.MarkFile(); var channel = ctx.ServiceControlChannel(); _consensusModuleProxy = new ConsensusModuleProxy(aeron.AddPublication(channel, ctx.ConsensusModuleStreamId())); _serviceAdapter = new ServiceAdapter(aeron.AddSubscription(channel, ctx.ServiceStreamId()), this); _sessionMessageHeaderEncoder.WrapAndApplyHeader(headerBuffer, 0, new MessageHeaderEncoder()); aeron.AddCloseHandler(abortHandler); }
internal void Connect(Aeron.Aeron aeron) { if (null != _responsePublication) { throw new InvalidOperationException("Response publication already present"); } _responsePublication = aeron.AddPublication(_responseChannel, _responseStreamId); }
internal void Connect(Aeron.Aeron aeron) { if (null == _responsePublication) { try { _responsePublication = aeron.AddPublication(ResponseChannel, ResponseStreamId); } catch (RegistrationException ex) { _clusteredServiceAgent.HandleError(ex); } } }
internal ClusteredServiceAgent(ClusteredServiceContainer.Context ctx) { this.ctx = ctx; archiveCtx = ctx.ArchiveContext(); aeron = ctx.Aeron(); service = ctx.ClusteredService(); idleStrategy = ctx.IdleStrategy(); serviceId = ctx.ServiceId(); epochClock = ctx.EpochClock(); markFile = ctx.MarkFile(); var channel = ctx.ServiceControlChannel(); _consensusModuleProxy = new ConsensusModuleProxy(aeron.AddPublication(channel, ctx.ConsensusModuleStreamId())); _serviceAdapter = new ServiceAdapter(aeron.AddSubscription(channel, ctx.ServiceStreamId()), this); }
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); }