plumpy.event_helper module

class plumpy.event_helper.EventHelper(listener_type: Type[ProcessListener])[source]

Bases: plumpy.persistence.Savable

_auto_persist: Optional[Set[str]] = {'_listener_type', '_listeners'}
add_listener(listener: ProcessListener)None[source]
fire_event(event_function: Callable[[], Any], *args: Any, **kwargs: Any)None[source]

Call an event method on all listeners.

Parameters
  • event_function – the method of the ProcessListener

  • args – arguments to pass to the method

  • kwargs – keyword arguments to pass to the method

property listeners
remove_all_listeners()None[source]
remove_listener(listener: ProcessListener)None[source]