예제 #1
0
        protected PanteonWorker(ILogger workerLogger, IWorkerSettings workerSettings, IHistoryStorage historyStorage)
        {
            HistoryStorage = historyStorage;
            WorkerLogger = workerLogger;
            WorkerSettings = workerSettings;
            _schtick = new Schtick();

            Multiplexer = ConnectionMultiplexer.Connect(WorkerSettings.RedisConnectionString);
            TaskWrapper = new RedisSchtickWrapper(() => Multiplexer.GetDatabase(WorkerSettings.DbNo));
        }
예제 #2
0
        internal ScheduledTask(Schtick schtick, string name, Schedule schedule, ScheduledTaskCallback callback, ScheduledTaskAsyncCallback asyncCallback)
        {
            _schtick = schtick;
            Name     = name;
            Schedule = schedule;

            if ((callback == null) == (asyncCallback == null))
            {
                throw new Exception("callback or asyncCallback must be specified, but not both.");
            }

            Callback      = callback;
            AsyncCallback = asyncCallback;
        }
예제 #3
0
        internal ScheduledTask(Schtick schtick, string name, Schedule schedule, ScheduledTaskCallback callback, ScheduledTaskAsyncCallback asyncCallback)
        {
            _schtick = schtick;
            Name = name;
            Schedule = schedule;

            if ((callback == null) == (asyncCallback == null))
                throw new Exception("callback or asyncCallback must be specified, but not both.");

            Callback = callback;
            AsyncCallback = asyncCallback;
        }