[Tutor] pass argument into running program *outside* of program
Alan Gauld
alan.gauld at btinternet.com
Fri Aug 22 11:28:44 CEST 2008
"Alan Gauld" <alan.gauld at btinternet.com> wrote
>> $ program.py addMe <username> <var2>
>
> create the server with a socket that listens for clients on a port
> create a client that talks to the socket via that port.
>
Other options, cruder but arguably simpler, involve
sharing a database and using one table for input and another
for output. The server polls the input table and writes output to
the output table, the clients write requests into the input table
and read their results out from the output table.
This is surprisingly efficient and scaleable, I've had servers
handling several hundred simultaneous clients using this
scheme. Its very good where reliability and resiliance are
important because even if the machine goes dowen the clients
and servers can restart and pick up where they left off.
Just a thought...
Alan G.
More information about the Tutor
mailing list