Previous topic

event_queue

Next topic

events

This Page

event_system

class pyogp.lib.base.event_system.AppEventEnum
enumeration of application level events and their keys
class pyogp.lib.base.event_system.AppEventsHandler(settings=None)

general class handling individual events

initialize the AppEventsHandler

handle(event)
essentially a case statement to pass event data to notifiers
is_event_handled(event_name)
if the event is being monitored, return True, otherwise, return False
register(event_name, timeout=0)
create a watcher for a specific event in this event system. the timeout is optional, and defaults to no timeout
class pyogp.lib.base.event_system.AppEvent(name, payload=None, llsd=None, **kwargs)

container for an event payload.

name = name of the event, to which applications will subscribe. payload = dict of the contents of the event (key:value) **kwdargs = key:value pairs

either payload or **kwdargs should be used, not both

initialize the AppEvent contents

from_llsd()
transform llsd into an event payload
to_llsd()
transform the event payload into llsd
class pyogp.lib.base.event_system.AppEventNotifier(event_name, settings, timeout=0)

access points for subscribing to application wide events. timeout = 0 for no timeout

initialize an event notifier by name, with an optional timeout

received(event)
notifies subscribers about an event firing and passes along the data
subscribe(*args, **kwdargs)
register a callback handler for a specific event, starting the timer if != 0, otherwise it will watch until forced to unsubscribe by the caller
unsubscribe(*args, **kwdargs)
stop watching this event