Next Previous Contents

1.1 Name

ants --- Library for running distributed scripts.

1.2 Synopsis


package require com.fishpool.ants ?1.0?

ants::connect addr port

ants::eval chan name arguments script msgCallback ?endOfScriptCallBack?

ants::lsServers channel

1.3 Description

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.

1.4 External requirements

1.5 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.

1.6 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:

This command returns immediately and leaves script to run in the background.

1.7 Author

The Ants library was created by Kristoffer Lawson, setok@fishpool.com.

1.8 References


Next Previous Contents