def __init__()

in codeguru_profiler_agent/utils/scheduler.py [0:0]


    def __init__(self,
                 command,
                 delay_provider=None,
                 initial_delay=datetime.timedelta(),
                 thread_name=None,
                 args=None,
                 kwargs=None):
        """
        Creates and executes a periodic action that will be run first without any delay and subsequently with the
        given delay between the termination of one execution and the commencement of the next.
        Scheduled thread gets terminated if exception thrown, hence subsequent execution will not happen.
        The scheduler can be paused, it will then keep running but not execute the command until resume() is called.

        :param command: a new thread will be spawned for executing this command with arguments
            specified in args and kwargs
        :param delay_provider: function providing the delay between executions as a timedelta, default returns always 1s
        :param initial_delay: delay before first execution as a timedelta, default is 0s.
        :param thread_name: name of the new spawned thread
        :param args: (list) passing argument by its position
        :param kwargs: (dict) passing argument by the arguments' names
        """
        self._command = command
        self._thread = \
            threading.Thread(target=self._schedule_task_execution, name=thread_name)
        self._thread.daemon = True
        self._args = args if args is not None else []
        self._kwargs = kwargs if kwargs is not None else {}
        self._state = ExecutionState(
            delay_provider=delay_provider if delay_provider else lambda: datetime.timedelta(seconds=1),
            initial_delay=initial_delay)