Studio:AutoScript Messages: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
* Its owner (ascript.Messages.Item().Owner) will have a Broadcast method.
* Its owner (ascript.Messages.Item().Owner) will have a Broadcast method.


* Its user object (ascript.Messages.Item().User) will have a Subscribe method and Unsubscribe 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.
* These are the only methods available for this message type. Thus other message methods (e.g. Register/Unregister) will not be available.

Revision as of 20:52, 9 July 2008

There are several types of messaging performed by STRIDE. These include:

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.

One-Way Command Messaging

One-Way Response Messaging

Two-Way Command/Response Messaging