scheduled_tasks

Code.scheduled_tasks.run_threaded(target, daemon=None, args=(), **kwargs)[source]

Run a function in a thread.

Allows to run a function in a thread, which is useful for long-running tasks, and it allows the main thread to continue.

Parameters:
target : Callable

The function to run in a thread.

daemon : Optional[pybool]

Whether the thread should be a daemon thread.

args : Iterable

The positional arguments to pass to the function.

kwargs : Mapping[str, Any]

The keyword arguments to pass to the function.

Returns:
threading.Thread

The thread that the function is running in.

Examples

>>> run_threaded(target=Log.Info, daemon=True, args=['Hello, world!'])
"Hello, world!"
Code.scheduled_tasks.schedule_loop()[source]

Start the schedule loop.

Before the schedule loop is started, all jobs are run once.

Examples

>>> schedule_loop()
...
Code.scheduled_tasks.setup_scheduling()[source]

Sets up the scheduled tasks.

The Tasks setup depend on the preferences set by the user.

See also

plex_api_helper.scheduled_update
Scheduled function to update the themes.

Examples

>>> setup_scheduling()
...