1. Introducing the ToolTalk Service
2. An Overview of the ToolTalk Service
4. Setting Up and Maintaining the ToolTalk Processes
5. Maintaining Application Information
6. Maintaining Files and Objects Referenced in ToolTalk Messages
7. Participating in ToolTalk Sessions
Identifying and Processing Messages Easily
Recognizing and Handling Replies Easily
Rejecting or Failing a Request
13. Managing Information Storage
A. Migrating from the Classing Engine to the ToolTalk Types Database
B. A Simple Demonstration of How the ToolTalk Service Works
You can tell the ToolTalk service to invoke a callback when a message arrives because a pattern has been matched.
|
Note - Callbacks are called in reverse order of registration (for example, the most recently added callback is called first).
illustrates how the ToolTalk service invokes message and pattern callbacks when tt_message_receive is called to retrieve a new message.
Figure 11-1 How Callbacks Are Invoked
After the ToolTalk service determines the receiver for a message addressed to a handler, it matches the message against any patterns registered by the receiver. (Messages explicitly addressed to handlers are point-to-point messages and do not use pattern matching.)
If the message does not match a pattern, the message is delivered in the normal manner.
If the message is matched to a pattern, any callbacks attached to the pattern are run.
Numeric tags (opnums) can be attached to each signature in a ptype when a static pattern is created. A callback can now be attached to the opnum. When a message is delivered because it matched a static pattern with an opnum, the ToolTalk service checks for any callbacks attached to the opnum and, if any exists, runs them.