Dispatch

class specviz.core.comms.Dispatch[source]

Bases: object

Central communications object for all events.

Methods Summary

register_event(name[, args]) Add an EventNode to the list of possible events
register_listener(name, func) Add a listener to an event
unregister_listener(name, func) Remove a listener from an event

Methods Documentation

register_event(name, args=None)[source]

Add an EventNode to the list of possible events

Parameters:
  • name (str) – The name of the event.
  • args ([arg, ..]) – The list of keyword arguments this event will pass to its handlers.
register_listener(name, func)[source]

Add a listener to an event

Parameters:
  • name (str) – The event name to add the listener to.
  • func (function) – The function that will be called when the is emitted
unregister_listener(name, func)[source]

Remove a listener from an event

Parameters:
  • name (str) – The event from wich the listener should be removed.
  • func (function) – The function to be removed