public AsyncBackgroundJobPerformer([NotNull] IJobFilterProvider filterProvider, [NotNull] IAsyncBackgroundJobPerformer innerPerformer)
        {
            if (filterProvider == null)
            {
                throw new ArgumentNullException(nameof(filterProvider));
            }
            if (innerPerformer == null)
            {
                throw new ArgumentNullException(nameof(innerPerformer));
            }

            _filterProvider = filterProvider;
            _innerPerformer = innerPerformer;
        }
            public Performance(PerformContext context, object[] filters, IAsyncBackgroundJobPerformer innerPerformer)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }
                if (filters == null)
                {
                    throw new ArgumentNullException(nameof(filters));
                }
                if (innerPerformer == null)
                {
                    throw new ArgumentNullException(nameof(innerPerformer));
                }

                _context        = context;
                _filters        = new DualCursor(filters);
                _innerPerformer = innerPerformer;
            }
Пример #3
0
        public WorkerTask(string[] queues, IAsyncBackgroundJobPerformer performer, IBackgroundJobStateChanger stateChanger)
        {
            if (queues == null || queues.Length == 0)
            {
                throw new ArgumentNullException(nameof(queues));
            }
            if (performer == null)
            {
                throw new ArgumentNullException(nameof(performer));
            }
            if (stateChanger == null)
            {
                throw new ArgumentNullException(nameof(stateChanger));
            }

            _queues       = queues;
            _performer    = performer;
            _stateChanger = stateChanger;
            _workerId     = Guid.NewGuid().ToString();
        }