Index
busylight_core.mixins
¶
Mixin classes for extending Light functionality.
Classes¶
busylight_core.mixins.ColorableMixin
¶
busylight_core.mixins.TaskableMixin
¶
Associate and manage asynchronous tasks.
Tasks can be added and cancelled.
Attributes¶
busylight_core.mixins.TaskableMixin.tasks
cached
property
¶
Active tasks that are associated with this class.
Functions¶
busylight_core.mixins.TaskableMixin.add_task
¶
Create a new task using coroutine as the body and stash it in the tasks dict.
Using name as a key for the tasks dictionary.
:name: str :coroutine: Awaitable :return: asyncio.Task
Source code in src/busylight_core/mixins/taskable.py
busylight_core.mixins.TaskableMixin.cancel_task
¶
Cancel a task associated with name if it exists.
If the task exists the cancelled task is returned, otherwise None.
:name: str :return: None | asyncio.Task