Pubsub Package
The publish-subscribe package is called pubsub. It provides the
following modules:
- pub: pubsub’s main module. It provides, first and foremost,
functions for sending messages and subscribing listeners. It provides
functions and classes for tracking pubsub usage, handling exceptions
in listeners, specificying topics, and various others.
- utils: subpackage of utility functions and classes, it provides
basic pubsub usage trackers, exception handlers, topic tree printer,
and more. These can also serve as examples of how to create your
own trackers/handlers/etc.
A few other modules inside pubsub are specific to configuring the pubsub API
and must be used only ONCE in an application:
- setupkwargs: module to setup pubsub to use “kwargs” messaging protocol
of the Argspec API. This API and protocol are the default so it is
not usually necessary to use setupkwargs.
- setupv1: (deprecated) module to force pubsub to use the legacy
“version 1” (aka v1) API. Should only be useful to wxPython users
for legacy code.
- setuparg1: module to setup pubsub to use “arg1” messaging protocol of
the Argspec API. This supports the same messaging semantics as legacy API
but with the Argspec API, useful when transitioning an application
from legacy to Argspec API.
The following two sections list tasks supported by pubsub, such as
publishing or receiving messages, and link directly to parts of the
documentation related to those tasks.
Alternately, the section
Modules and sub-packages shows a Reference Table-of-Contents
view of the pages describing the modules and associated concepts/principles.
Essential Functionality
Tasks that are essential when using pubsub are:
They are in the pub module.
Modules and sub-packages
Supported tasks are distributed among several modules modules and packages: