next up previous contents index
Next: Subsequences Up: Events Previous: Script Clients

Predefined Events


  Glish predefines several events for every client to provide automatic access to the client's state:

is       generated when a client first begins running. Return of the client call does not guarantee that the client is now running (especially if the async=T option has been used; see § 7.8.1, page gif, above). A client's established event is usually of interest only with asynchronous clients, since you can send events to a client and execute whenever statements referring to a client before the client has become established.

is       generated when a client does not recognize an event sent to it. By convention, clients also generate error events when an event sent to them is erroneous in some way (for example, a mandatory field is missing from the event's value), but error events are not (yet) automatically generated.

is       generated when the client finishes successfully. Contrast with:

is       generated on behalf of a client that terminates abnormally. For example, if a client faults due to a bus error and crashes, the Glish interpreter will detect the client's failure and generate a fail event. If communication with a client is lost due to network problems, though, then Glish may not detect the problem for a long time.

      can be sent to any client to tell it to exit. All clients are sent implicit terminate events when a Glish program terminates due to an exit statement (§ 5.8, page gif).

    These events form the mechanism by which you can control clients and detect their errors. In general if a client generates an event which has no corresponding whenever specifying what to do when that   event occurs, then the Glish interpreter generates a warning message. This message is not generated, though, for unnoticed established and done events.

Ideally we would like the above events to apply to all agents and not just clients. That is, we would like subsequences (see the next section) to generate and respond to these events, too. Presently,   however, these events only apply to clients (``clients" here includes asynchronous shell commands; see § 7.8.2, page gif).  

next up previous contents index
Next: Subsequences Up: Events Previous: Script Clients

Thu Nov 13 16:44:05 EST 1997