Pybus -- A Python Software Bus Page: 2 of 4
This article is part of the collection entitled: Office of Scientific & Technical Information Technical Reports and was provided to UNT Digital Library by the UNT Libraries Government Documents Department.
Extracted Text
The following text was automatically extracted from the image on this page using optical character recognition software:
User
Interface
User
PyBus --Interface
User
Interface(B)
Time
PyBus
User
Interface
PyBus
User
InterfaceUser
PyBus Interface(C)
Figure 1: A software bus anonymizes communications to allow for space decoupling, e.g. multiple interfaces using the
same module (A). Time decoupling, e.g. an interface can use data produced by a module without being connected at the
same time (B). And synchronization decoupling (C), e.g. the interface is notified through a callback when the work done
by a module is finished, thus, it need not block. [6]Symbolic Component Names and Lookup
Python modules are loaded on the basis of names that
map directly to the filesystem; components are loaded ac-
cording to the functionality that is requested. A request
for functionality that is known by PYBUS is followed by
localizing the module that contains a component with that
functionality, and performing the appropriate steps, which
may include downloading the component from a cache and
installing it, to load it into the Python interpreter.
When a user requests a component to be connected, she
can do so with the logical, functional, or actual name.
Components that are available to PYBUS must be regis-
tered first under logical names, optionally advertising un-
der functional names the public contracts that they fulfill
(their "interfaces" in a sense). Note that registered does not
mean that it has to be available: upon a request to connect
a module, it may need to be retrieved or configured first.
If a component is not registered, it can only be connected
using its actual name, which is the name that would be used
in the standard way of identifying a Python module. Un-
like the actual name, which has to be unique, the logical
name and functional names may be claimed by more than
one component. PYBUS will choose among the available
components on the basis of its own configuration, a priority
scheme, or a direct action from the user.
Connecting, Disconnecting and Replacing
Connections that are based on symbolic names allow the
application writer to integrally replace a (version of a) com-ponent throughout the application at startup. PYBUS adds
the capability to search through outstanding references to
replace or remove these individually once the component
to which they point gets replaced, or removed, at run-time.
The replacement of modules is achieved by using the
garbage collection and reference-counting information of
the Python interpreter to track down any outstanding refer-
ences, and to act accordingly: some references, e.g. those
to variables or instances, are rebound, whereas others, e.g.
object instances, are destroyed. Disconnecting a compo-
nent is rather similar to replacing it, with the only exception
that no references are rebound: all are destroyed.
Configuration and Dependencies
A PYBUS-enabled module advertises configuration pa-
rameters and dependencies that can subsequently be exter-
nalized and managed globally. This allows for integral, site
specific environment setups.
In the process of connecting a module, PYBUS will look
for conventional parameters (starting with "PyBus_") in
the dictionary of the module that contains the component.
These parameters may describe dependencies, new compo-
nents to be registered, post-connect or pre-disconnect con-
figuration, and so on. It is purely optional for a module to
provide any of these parameters and PYBUS will use some
heuristics if they are absent. For example, all public identi-
fiers are considered part of the interface, so that any module
can be connected as if it were a component. The user can
decide the name under which the module should be con-
nected, which can be any alias that stands in for the name(A)
Upcoming Pages
Here’s what’s next.
Search Inside
This article can be searched. Note: Results may vary based on the legibility of text within the document.
Tools / Downloads
Get a copy of this page or view the extracted text.
Citing and Sharing
Basic information for referencing this web page. We also provide extended guidance on usage rights, references, copying or embedding.
Reference the current page of this Article.
Lavrijsen, Wim T.L.P. Pybus -- A Python Software Bus, article, October 14, 2004; Berkeley, California. (https://digital.library.unt.edu/ark:/67531/metadc782042/m1/2/: accessed April 18, 2024), University of North Texas Libraries, UNT Digital Library, https://digital.library.unt.edu; crediting UNT Libraries Government Documents Department.