Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: servers.agents - Function Up: servers - Tool Previous: servers.init - Function


servers.alerter - Function



Package utility
Module tasking
Tool servers


Relay events on completion


Synopsis
alerter()


Description
servers works internally by sending and receiving events. When running synchronously these events are converted into return values as appropriate. However, when running asynchronously, one needs a mechanism to emit events that can be caught outside. The alerter function provides this mechanism.

The events emitted are:

error
The job ended in error.
fail
The server failed.
note
A note was issued.
'jobid'
The job with id 'jobid' ended successfully.

The value returned by the event is a record with fields:

agent
The agent used in execution.
value
The value.

Here is an example of how to execute a function asynchronously and set up a whenever on the result:

im:=imager('3C273XC1.ms')
jobid:=im.plotvis(async=T);
whenever defaultservers.alerter()->[as_string(jobid)] do {
  print 'Plot finished';
  deactivate;
}



Returns
Agent record for receiving events and their results




next up previous contents index
Next: servers.agents - Function Up: servers - Tool Previous: servers.init - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15