Public Member Functions | |
def | __init__ |
def | subscribe |
def | subscribe_once |
def | subscribe_repeating |
def | trigger |
def | unsubscribe_all |
Private Member Functions | |
def | _subscription_change |
Private Attributes | |
_name | |
_subscribers |
Definition at line 122 of file graveyard/event.py.
def event::Event::__init__ | ( | self, | ||
name = "Unnamed Event" | ||||
) |
Definition at line 123 of file graveyard/event.py.
def event::Event::_subscription_change | ( | self | ) | [private] |
Called at the end of each subscribe/unsubscribe. Can be overloaded in derived classes.
Definition at line 162 of file graveyard/event.py.
def event::Event::subscribe | ( | self, | ||
cb, | ||||
args, | ||||
kwargs, | ||||
repeating = True | ||||
) |
Subscribes to an event. Can be called at any time and from any thread. Subscriptions that occur while an event is being triggered will not be called until the next time the event is triggered.
Definition at line 128 of file graveyard/event.py.
def event::Event::subscribe_once | ( | args, | ||
kwargs | ||||
) |
Definition at line 140 of file graveyard/event.py.
def event::Event::subscribe_repeating | ( | args, | ||
kwargs | ||||
) |
Definition at line 145 of file graveyard/event.py.
def event::Event::trigger | ( | args, | ||
kwargs | ||||
) |
Triggers an event. Concurrent triggers of a given callback are serialized using a lock, so triggering from a callback will cause a deadlock.
Definition at line 150 of file graveyard/event.py.
def event::Event::unsubscribe_all | ( | self, | ||
blocking = True | ||||
) |
Unsubscribes all subscribers that were present at the start of the call.
Definition at line 167 of file graveyard/event.py.
event::Event::_name [private] |
Definition at line 124 of file graveyard/event.py.
event::Event::_subscribers [private] |
Definition at line 125 of file graveyard/event.py.