Exemple #1
0
 public ResQueue(string context, string queueId, string subscriberId, string filter, DateTime startTime, QueueRequestAcceptor acceptor)
 {
     _queueId = queueId;
     _subscriberId = subscriberId;
     _context = context;
     _filter = filter;
     _startTime = startTime;
     _acceptor = acceptor;
 }
Exemple #2
0
        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.");
        }