internal AsyncFlushHandler(IBatchFactory batchFactory,
                                   IRequestHandler requestHandler,
                                   int maxQueueSize,
                                   int maxBatchSize,
                                   int flushIntervalInMillis)
        {
            _queue = new BlockingQueue <BaseAction>();

            this._batchFactory   = batchFactory;
            this._requestHandler = requestHandler;

            this.MaxQueueSize      = maxQueueSize;
            this.MaxBatchSize      = maxBatchSize;
            _flushIntervalInMillis = flushIntervalInMillis;

#if NET_NOTHREAD
            // set that the queue is currently empty
            _idle = new ManualResetEvent(true);

            _continue = new CancellationTokenSource();

            // start the long running flushing task
            Task.Factory.StartNew(() => Loop(), _continue.Token);
#else
            _continue = true;

            // set that the queue is currently empty
            _idle = new ManualResetEvent(true);

            // start the flushing thread
            _flushingThread = new Thread(new ThreadStart(Loop));
            _flushingThread.Start();
#endif
        }
		internal BlockingFlushHandler(IBatchFactory batchFactory, 
		                         IRequestHandler requestHandler)
		{

			this._batchFactory = batchFactory;
			this._requestHandler = requestHandler;
		}
Esempio n. 3
0
 internal void Initialize(IBatchFactory batchFactory, IRequestHandler requestHandler, int maxQueueSize, bool async)
 {
     this.dataStore      = new LocalStore();
     this.batchFactory   = batchFactory;
     this.requestHandler = requestHandler;
     this.MaxQueueSize   = maxQueueSize;
     this.Async          = async;
     this.context        = this.GetContext();
 }
 public LeaguesService(
     IUnitOfWork unitOfWork,
     IFootballDataService footballDataService,
     IBatchFactory batchFactory,
     IMapper mapper)
 {
     _unitOfWork          = unitOfWork;
     _footballDataService = footballDataService;
     _batchFactory        = batchFactory;
     _mapper = mapper;
 }
 public BatchingFlushHandler(
     IBatchFactory batchFactory,
     IRequestHandler requestHandler,
     int minBatchSize,
     int maxQueueSize,
     TimeSpan minInterval
     ) : this()
 {
     this.requestHandler = requestHandler;
     this.batchFactory   = batchFactory;
     this.minBatchSize   = minBatchSize;
     this.maxQueueSize   = maxQueueSize;
     this.minInterval    = minInterval;
 }
        public BatchingFlushHandler(
			IBatchFactory batchFactory, 
			IRequestHandler requestHandler, 
			int minBatchSize, 
			int maxQueueSize, 
			TimeSpan minInterval
		)
            : this()
        {
            this.requestHandler = requestHandler;
            this.batchFactory = batchFactory;
            this.minBatchSize = minBatchSize;
            this.maxQueueSize = maxQueueSize;
            this.minInterval = minInterval;
        }
Esempio n. 7
0
        internal AsyncFlushHandler(IBatchFactory batchFactory, IRequestHandler requestHandler, int maxQueueSize)
        {
            this.queue = new BlockingQueue<BaseAction>();
            this.batchFactory = batchFactory;
            this.requestHandler = requestHandler;
            this.MaxQueueSize = maxQueueSize;
            this.isDisposed = false;
            
            // set that the queue is currently empty
            this.idle = new ManualResetEvent(true);

            // start the flushing thread
            this.flushingThread = new Thread(new ThreadStart(this.Loop));
            this.flushingThread.Start();
        }
Esempio n. 8
0
        internal AsyncIntervalFlushHandler(IBatchFactory batchFactory,
                                           IRequestHandler requestHandler,
                                           int maxQueueSize,
                                           int maxBatchSize,
                                           int flushIntervalInMillis)
        {
            _queue                 = new ConcurrentQueue <BaseAction>();
            _batchFactory          = batchFactory;
            _requestHandler        = requestHandler;
            _maxQueueSize          = maxQueueSize;
            _maxBatchSize          = maxBatchSize;
            _continue              = new CancellationTokenSource();
            _flushIntervalInMillis = flushIntervalInMillis;

            RunInterval();
        }
        internal AsyncFlushHandler(IBatchFactory batchFactory,
                                   IRequestHandler requestHandler,
                                   int maxQueueSize)
        {
            _queue = new BlockingQueue <BaseAction>();

            this._batchFactory   = batchFactory;
            this._requestHandler = requestHandler;

            this.MaxQueueSize = maxQueueSize;

            // set that the queue is currently empty
            _idle = new ManualResetEvent(true);

            _continue = new CancellationTokenSource();

            // start the long running flushing task
            Task.Factory.StartNew(() => Loop(), _continue.Token);
        }
        internal AsyncFlushHandler(IBatchFactory batchFactory, 
		                         IRequestHandler requestHandler, 
		                         int maxQueueSize)
        {
			_queue = new BlockingQueue<BaseAction>();

			_batchFactory = batchFactory;
			_requestHandler = requestHandler;
            
			MaxQueueSize = maxQueueSize;

			// set that the queue is currently empty
			_idle = new ManualResetEvent(true);

			_continue = new CancellationTokenSource();

			// start the long running flushing task
			Task.Factory.StartNew (() => Loop (), _continue.Token);
        }
Esempio n. 11
0
        internal AsyncFlushHandler(IBatchFactory batchFactory,
                                   IRequestHandler requestHandler,
                                   int maxQueueSize)
        {
            _queue = new BlockingQueue <BaseAction>();

            this._batchFactory   = batchFactory;
            this._requestHandler = requestHandler;

            this.MaxQueueSize = maxQueueSize;

            _continue = true;

            // set that the queue is currently empty
            _idle = new ManualResetEvent(true);

            // start the flushing thread
            _flushingThread = new Thread(new ThreadStart(Loop));
            _flushingThread.Start();
        }
		internal AsyncFlushHandler(IBatchFactory batchFactory,
								 IRequestHandler requestHandler,
								 int maxQueueSize)
		{
			_queue = new BlockingQueue<BaseAction>();

			_batchFactory = batchFactory;
			_requestHandler = requestHandler;

			MaxQueueSize = maxQueueSize;

			_continue = true;

			// set that the queue is currently empty
			_idle = new ManualResetEvent(true);

			// start the flushing thread
			var flushingThread = new Thread(Loop);
			flushingThread.Start();
		}
Esempio n. 13
0
 internal BlockingFlushHandler(IBatchFactory batchFactory,
                               IRequestHandler requestHandler)
 {
     this._batchFactory   = batchFactory;
     this._requestHandler = requestHandler;
 }
Esempio n. 14
0
 public DecisionBase(IBatchFactory factory, int qty)
 {
     this.factory = factory;
     this.qty     = qty;
 }
Esempio n. 15
0
 public BatchProcessor(ILogger <BatchProcessor> logger, IBatchFactory factory, IDataSession dataSession)
 {
     _factory     = factory;
     _logger      = logger;
     _dataSession = dataSession;
 }
 protected DecisionBase(IBatchFactory factory, int quantity)
 {
     _factory  = factory;
     _quantity = quantity;
 }
Esempio n. 17
0
 public BatchProcessor(IBatchFactory factory)
 {
     _factory = factory;
 }
Esempio n. 18
0
 public BatchProcessor(IBatchFactory factory)
 {
     _factory = factory;
 }