[Baypiggies] Suggestions on some python client/server development.

William Deegan bdbaddog at gmail.com
Tue Nov 23 21:06:43 CET 2010


I need to replace an existing c/c++ system which handles requests for
constrained resources.

Currently there's a server which reads a list of tokens and # available.
token_a 1
token_b 55
token_c 9

There's a client which waits until a token of the requested token type
is available and then runs the command line provided:

wait_for_token -token token_a -maxwait 50  /bin/echo "Got the token"

The user can specify the token name, the maximum amount of time to
wait for the token, and the command to run.
The token is not released until the command line specified completes.

It is possible that the wait_for_token could be killed via control-c
or a SIGKILL, in which case the token still must be released in some

Currently the client holds a socket open to the server, so the token
is released when the process is killed because the socket gets dropped
on the client side.

I'd like to add (among other things) a web based, or minimally a html
page written by the server with the current list of who has each
token, and who's waiting, and what time the started waiting and
obtained the token.

I'm thinking that perhaps a server (and maybe client) based on twisted
might make sense?
Or perhaps some web app framework? (and REST?)

It needs to be able to handle up to 200 requests per second, but most
likely < 10-20 request per second.
The commands typically run for minutes so sub-second response times
are not necessary.

I've not done anything like this in python yet, so I figured I'd float
it out to the group for some suggestions on where to start and/or
which technologies/packages might be useful to avoid just replicating
exactly the c++ code..


More information about the Baypiggies mailing list