API: Decorators: Threaded class and threaded function.¶
-
class
threaded.
Threaded
[source]¶ Run function in separate thread.
-
__init__
(name=None, daemon=False, started=False)[source]¶ Parameters: - name (typing.Optional[typing.Union[str, typing.Callable[.., typing.Union[typing.Any, typing.Awaitable]]]]) – New thread name. If callable: use as wrapped function. If none: use wrapped function name.
- daemon (bool) – Daemonize thread.
- started (bool) – Return started thread
Note
Attributes is read-only.
-
name
¶ typing.Optional[str]
- New thread name. If none: use wrapped function name.
-
started
¶ bool
-
daemon
¶ bool
-
_func
¶ Wrapped function. Used for inheritance only.
-
-
threaded.
threaded
(name=None, daemon=False, started=False)[source]¶ Run function in separate thread.
Parameters: - name (typing.Optional[typing.Union[str, typing.Callable[.., typing.Union[typing.Any, typing.Awaitable]]]]) – New thread name. If callable: use as wrapped function. If none: use wrapped function name.
- daemon (bool) – Daemonize thread.
- started (bool) – Return started thread
Return type: typing.Union[Threaded, typing.Callable[.., threading.Thread]]