public ResQueueEngine(string endpoint) { _log.DebugFormat("[ResQueueEngine] Starting at {0}...", endpoint); const int bufferSize = 11; TimeSpan reaperForDeadTasksInterval = TimeSpan.FromSeconds(2); var buffer = new MultiWriterSingleReaderBuffer(bufferSize); _acceptor = new QueueRequestAcceptor(buffer); //important: socket needs to be created on request processor main thread. Func<ResGateway> gatewayFactory = () => new SingleThreadedZeroMqGateway(endpoint, reaperForDeadTasksInterval); _processor = new RequestProcessor(gatewayFactory, buffer); _processor.Start(); _log.Debug("[ResQueueEngine] Started."); }
private void start(string endpoint) { if (_isDisabled) { _log.Warn("[ResPublishEngine] ResPublishEngine is disabled. Requested clients will be dummies, and will immediately return default values instead of committing events."); return; } _log.Debug("[ResPublishEngine] Starting..."); const int bufferSize = 11; TimeSpan reaperForDeadTasksInterval = TimeSpan.FromSeconds(2); var buffer = new MultiWriterSingleReaderBuffer(bufferSize); _acceptor = new CommitRequestAcceptor(buffer); //important: socket needs to be created on request processor main thread. Func<ResGateway> gatewayFactory = () => new SingleThreadedZeroMqGateway(endpoint, reaperForDeadTasksInterval); _processor = new RequestProcessor(gatewayFactory, buffer); _processor.Start(); _log.Debug("[ResPublishEngine] Started."); }