def __init__(self, config=None, resources=None, task_history_impl=None, **kwargs):
        """
        Keyword Arguments:
        :param config: an object of class "scheduler" or None (in which the global instance will be used)
        :param resources: a dict of str->int constraints
        :param task_history_impl: ignore config and use this object as the task history
        """
        self._config = config or scheduler(**kwargs)
        self._state = SimpleTaskState(self._config.state_path)

        if task_history_impl:
            self._task_history = task_history_impl
        elif self._config.record_task_history:
            from luigi import db_task_history  # Needs sqlalchemy, thus imported here
            self._task_history = db_task_history.DbTaskHistory()
        else:
            self._task_history = history.NopHistory()
        self._resources = resources or configuration.get_config().getintdict('resources')  # TODO: Can we make this a Parameter?
        self._make_task = functools.partial(Task, retry_policy=self._config._get_retry_policy())
        self._worker_requests = {}
        self._paused = False

        if self._config.batch_emails:
            self._email_batcher = BatchNotifier()

        self._state._metrics_collector = MetricsCollectors.get(self._config.metrics_collector)
def __init__ ( self , config = None , resources = None , task_history_impl = None , ** kwargs ) : self . _config = config or scheduler ( ** kwargs ) self . _state = SimpleTaskState ( self . _config . state_path ) if task_history_impl : self . _task_history = task_history_impl elif self . _config . record_task_history : from luigi import db_task_history self . _task_history = db_task_history . DbTaskHistory ( ) else : self . _task_history = history . NopHistory ( ) self . _resources = resources or configuration . get_config ( ) . getintdict ( 'resources' ) self . _make_task = functools . partial ( Task , retry_policy = self . _config . _get_retry_policy ( ) ) self . _worker_requests = { } self . _paused = False if self . _config . batch_emails : self . _email_batcher = BatchNotifier ( ) self . _state . _metrics_collector = MetricsCollectors . get ( self . _config . metrics_collector )
Keyword Arguments:
        :param config: an object of class "scheduler" or None (in which the global instance will be used)
        :param resources: a dict of str->int constraints
        :param task_history_impl: ignore config and use this object as the task history