tribler.core.notifier
Classes
A Notification callback descriptor. |
|
All possible global events that happen in Tribler. |
|
The class responsible for managing and calling observers of global Tribler events. |
Module Contents
- class tribler.core.notifier.Desc
Bases:
NamedTupleA Notification callback descriptor.
- class tribler.core.notifier.Notification(*args, **kwds)
Bases:
enum.EnumAll possible global events that happen in Tribler.
- torrent_finished
- torrent_status_changed
- tribler_shutdown_state
- tribler_new_version
- remote_query_results
- local_query_results
- circuit_removed
- tunnel_removed
- torrent_health_updated
- low_space
- events_start
- tribler_exception
- content_discovery_community_unknown_torrent_added
- report_config_error
- peer_disconnected
- tribler_torrent_peer_update
- torrent_metadata_added
- new_torrent_metadata_created
- ask_add_download
- class tribler.core.notifier.Notifier
The class responsible for managing and calling observers of global Tribler events.
- observers: dict[Notification, list[collections.abc.Callable[Ellipsis, None]]]
- delegates: set[collections.abc.Callable[Ellipsis, None]]
- add(topic: Notification, observer: collections.abc.Callable[Ellipsis, None]) None
Add an observer for the given Notification type.
- notify(topic: Notification | str, /, **kwargs) None
Notify all observers that have subscribed to the given topic.