added options to the server process

This commit is contained in:
Stephen Mardson McQuay 2011-05-24 18:42:27 -06:00
parent 779608f13e
commit f79e538b67

View File

@ -1,7 +1,21 @@
#!/usr/bin/env python #!/usr/bin/env python
from interp.cluster import QueueManager from interp.cluster import QueueManager
from optparse import OptionParser
m = QueueManager(address=('', 6666), authkey='asdf') if __name__ == '__main__':
s = m.get_server() parser = OptionParser(usage = "usage: %s [options] <server> <interp count>")
s.serve_forever()
parser.add_option('-p', '--port',
type="int", dest="port", default=6666,
help="specify the port to use on the server (default: %default)")
parser.add_option('-a', '--auth-key',
type="str", dest="authkey", default='asdf',
help="authkey (default: %default)")
(options, args) = parser.parse_args()
m = QueueManager(address=('', options.port), authkey=options.authkey)
s = m.get_server()
s.serve_forever()