ants --- Library for running distributed scripts.
package require com.fishpool.ants ?1.0? ants::connect addr port ants::eval chan name arguments script msgCallback ?endOfScriptCallBack? ants::lsServers channel
Ants is a generic system for running any kind of distributed code, intended to replace application-specific systems like the one used by SETI@home. The idea is to be able to write scripts with areas defined to be run on the Ants network. These script fragments can then communicate with the original script by passing messages.
Scripts can process data on their own but often it may be more efficient to load in a library (written in C, for example) to do the heavy processing. Scripts can then use this library as they see fit. These libraries can then be spread on the net for users to install. So instead of spreading binary executables, interested parties can just distribute a library. They automatically fit into the communication framework.
This Tcl package provides an easy way to write and distribute Ants scripts.
ants::connect addr port
Connects to the Ants server listening at the specified address and port.
Returns a Tcl channel that can be used to communicate with the server.
ants::eval chan name arguments script msgCallback ?endOfScriptCallBack?
Requests the evaluation of script on the server at chan. The
script is evaluated in a safe interpreter and has all the restrictions
described in the manpage SafeBase(3). It may call package require,
but the list of available packages is up to the server configuration.
In addition the command sendMsg can be used within the script to
send a message back to the client. The format of the command is:
sendMsg msg
msg can contain any data and is up to the receiver to handle
it as it wishes.
Arguments:
chan Channel of server to send script to.name Identifier of script, used when identifying messages from
the server and debugging.arguments List of extra arguments available for use by the script.
These will be available in the global variable argv.script Script to evaluate on server.msgCallback Any message from the script will be appended to the
value of this arguent and the result evaluated.?endOfScriptCallback? This script is evaluated once script has
finished on the server.This command returns immediately and leaves script to run in
the background.
The Ants library was created by Kristoffer Lawson, setok@fishpool.com.