|
|
| __init__ (self) |
| |
| | add (self, event, subscriber, append=True) |
| |
| | remove (self, event, subscriber) |
| |
| | get_subscribers (self, event) |
| |
| | publish (self, event, *args, **kwargs) |
| |
A very simple publish/subscribe system.
◆ add()
| pip._vendor.distlib.util.EventMixin.add |
( |
|
self, |
|
|
|
event, |
|
|
|
subscriber, |
|
|
|
append = True |
|
) |
| |
Add a subscriber for an event.
:param event: The name of an event.
:param subscriber: The subscriber to be added (and called when the
event is published).
:param append: Whether to append or prepend the subscriber to an
existing subscriber list for the event.
◆ get_subscribers()
| pip._vendor.distlib.util.EventMixin.get_subscribers |
( |
|
self, |
|
|
|
event |
|
) |
| |
Return an iterator for the subscribers for an event.
:param event: The event to return subscribers for.
◆ publish()
| pip._vendor.distlib.util.EventMixin.publish |
( |
|
self, |
|
|
|
event, |
|
|
* |
args, |
|
|
** |
kwargs |
|
) |
| |
Publish a event and return a list of values returned by its
subscribers.
:param event: The event to publish.
:param args: The positional arguments to pass to the event's
subscribers.
:param kwargs: The keyword arguments to pass to the event's
subscribers.
◆ remove()
| pip._vendor.distlib.util.EventMixin.remove |
( |
|
self, |
|
|
|
event, |
|
|
|
subscriber |
|
) |
| |
Remove a subscriber for an event.
:param event: The name of an event.
:param subscriber: The subscriber to be removed.
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/pip/_vendor/distlib/util.py