:param Task|callable task: Add 'task' to the list of tasks to run periodically
        :param int|float|None frequency: Frequency at which to execute the task

def add_task(cls, task, frequency=None):
        """
        :param Task|callable task: Add 'task' to the list of tasks to run periodically
        :param int|float|None frequency: Frequency at which to execute the task
        """
        with cls._lock:
            if not isinstance(task, Task):
                t = Task(name=task.__name__, frequency=frequency)
                t.execute, task = task, t

            if frequency:
                task.frequency = frequency

            cls.tasks.append(task)
            cls.tasks.sort()