The Broker as a Module
The Broker, that is, the program which forwards the CALL FUNC and other
messages, is itself a module (called "Broker"), and implements some methods.
These are used by the graphical user interface (GUI) to the Broker.
The GUI is a standalone program that connects to the Broker like any other
client, inquires about the Broker's state by making function calls, and
displays the information.
NOTE: The information below is not
true. It describes what the method calls should look like, but they have
not been changed to look like this yet.
Connection
A Connection is the connection of a module to the server. Both the class
Connection and instances of the class are publications which can be subscribed
to.
Class Method
list
Lists all the modules connected to the broker
Instance Attributes
log
A log of all messages between the server and the module connected by this
connection.
The following methods can be used with the logs:
get
Return the a MULTILINE with the contents of the log.
subscribe
StartableServer
The broker has a class called StartableServer. StartableServers are identified
by their name, and support the methods:
Class Methods
list
Returns the names of all StartableServers, and the second adds a startable
server.
new <password> <name> <command-line> <restart> <startTimeout> <stopTimeout> <email>
Creates a new StartableServer with the specified attributes.
Note that the Broker's password (which was specified when the Broker was
started) must be specified.
This is not safe, because anyone can look at the transaction log and
see the password, and will be replaced with a digital signature scheme.
Instance Methods
stop
start
Stop and start the StartableServer. Return an error if a started server
is asked to start, or a non-running server is asked to stop.
info
Returns the following attributes of the server:
<name> <commandLine> <autoRestart> <startTimeout> <stopTimeout> <email> <status>
change <newName> <newCommandLine>
Changes the name and command line of the server.
Attributes
stderr
stdout
The logged standard input and output of the server, if it has been
started from the Broker. The following methods can be used with the logs:
get
Return the a MULTILINE with the contents of the log.
subscribe
Previous: Using the Broker from
Tcl, Up: Implementing Modules
© Copyright 1997 Erland
Lewin and the members of the Center
for Speech Technology