Studio:AutoScript Messages: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
STRIDE offers many types of messaging as well as many options on messaging. To ease your understanding, this section describes overall concepts and then describes the precise functionality that STRIDE provides. | |||
== Messaging Concepts == | |||
=== Origin and Directioning === | |||
STRIDE has the concept of a message owner and a message user. In general STRIDE usage, the Owner and User imply target and host, but for messaging the meaning isn't as clear. STRIDE messages relate to scripts. Thus, the meaning of owner and user may not be as concrete as the more general STRIDE terminology. | |||
=== Owner === | |||
For messaging, a message owner generally implies the responder (receiver) of message requests. This meaning is somewhat cloudy when dealing with broadcast messages, but then broadcast messages are still considered responses. Similarly, a | |||
=== User === | |||
For messaging, a message user generally implies the initiator (sender) of message requests. | |||
=== Synchronous / Asynchronous Messaging == | |||
Messages that are sent between a message owner and a message user may asynchronous or synchronous. | |||
==== Asynchronous Messaging ==== | |||
An asynchronous message is also known as a "non-blocking" message. The message transfers between message owner and message user and the from either | |||
==== Synchronous Messaging ==== | |||
=== Messaging Types === | |||
=== Bypass Override === | |||
== Broadcast Messaging == | == Broadcast Messaging == |
Revision as of 21:35, 9 July 2008
STRIDE offers many types of messaging as well as many options on messaging. To ease your understanding, this section describes overall concepts and then describes the precise functionality that STRIDE provides.
Messaging Concepts
Origin and Directioning
STRIDE has the concept of a message owner and a message user. In general STRIDE usage, the Owner and User imply target and host, but for messaging the meaning isn't as clear. STRIDE messages relate to scripts. Thus, the meaning of owner and user may not be as concrete as the more general STRIDE terminology.
Owner
For messaging, a message owner generally implies the responder (receiver) of message requests. This meaning is somewhat cloudy when dealing with broadcast messages, but then broadcast messages are still considered responses. Similarly, a
User
For messaging, a message user generally implies the initiator (sender) of message requests.
= Synchronous / Asynchronous Messaging
Messages that are sent between a message owner and a message user may asynchronous or synchronous.
Asynchronous Messaging
An asynchronous message is also known as a "non-blocking" message. The message transfers between message owner and message user and the from either
Synchronous Messaging
Messaging Types
Bypass Override
Broadcast Messaging
Broadcast messaging is used to have a message owner broadcast messages. A message user will subscribe to a message for a time. The message user will receive messages until the message user's script exits or until it unsubscribes from the message. The exact process for how this is achieved is as follows:
1. A Message User calls Subscribe() to register that it is interested in receiving message events from a given message.
2. When the Message Owner calls Broadcast(), a message event is sent to all Subscribers of the message. The message event received by the Message User is enqueued to its script's event queue. The Message User may then evaluate the messages it has received by making calls to WaitForEvent().
3. When a Message User no longer wishes to receive message events from a given message, it will call Unsubscribe() to unregister its interest in receiving events.
For a broadcast message (a message whose ascript.Messages.Item().Type is "BroadcastMessage"):
- Its owner (ascript.Messages.Item().Owner) will have a Broadcast method.
- Its user object (ascript.Messages.Item().User) will have a Subscribe method and an Unsubscribe method.
- These are the only methods available for this message type. Thus other message methods (e.g. Register/Unregister) will not be available.
Command/Response Messaging
The other form of messaging provided by STRIDE involves direct messaging between a message owner and message user. There are three types of direct messaging between a message owner and message user and they depend upon what information is being passed in which direction.
Message Type |
Meaning |
One-Way Command Messaging | The message user will only send a command payload to the message owner. The message user will not receive any information back from the message owner. |
One-Way Response Messaging | The message user will only receive a response payload from the message owner. The message owner will not receive any information from the message user. |
Two-Way Command/Response Messaging | The message user will send a command payload from the message owner AND it will receive a response payload as part of the messaging. |