Esempio n. 1
0
        public ResQueryEngine(string endpoint)
        {
            _log.DebugFormat("[ResQueryEngine] Starting at {0}...", endpoint);

            const int bufferSize = 11;

            TimeSpan reaperForDeadTasksInterval = TimeSpan.FromSeconds(2);

            var buffer = new MultiWriterSingleReaderBuffer(bufferSize);
            _acceptor = new QueryRequestAcceptor(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("[ResQueryEngine] Started.");
        }
Esempio n. 2
0
 public ThreadsafeResQueryClient(QueryRequestAcceptor acceptor, TimeSpan defaultTimeout)
 {
     _acceptor = acceptor;
     _defaultTimeout = defaultTimeout;
 }