xmlrpc.server.work() does not seem to handle multiple requests

Discussion in 'Python' started by john14, Feb 18, 2005.

  1. john14

    john14 Guest

    Hi,

    I have an xmlrpc server. I using the python package
    xmlrpc. Here is what I am doing:

    s = xmlrpc.server()
    s.addMethods(method_hash)
    s.bindAndListen(PORT)
    while 1:
    try:
    s.work()
    except:
    e = sys.exc_info()

    The problem is that when I send multiple requests they are queued and
    processed one after the other. Is there some other method that will allow
    me to process multiple request at the same time?

    Thank You
    john14, Feb 18, 2005
    #1
    1. Advertising

  2. Unfortunately no because this is a single threaded http server. It's
    great for testing stuff out, but it doesn't scale unless you make it
    scale. I am assuming you could use the Zope application server to
    scale your code.
    pythonUser_07, Feb 18, 2005
    #2
    1. Advertising

  3. john14

    Adonis Guest

    john14 wrote:
    > Hi,
    >
    > I have an xmlrpc server. I using the python package
    > xmlrpc. Here is what I am doing:
    >
    > s = xmlrpc.server()
    > s.addMethods(method_hash)
    > s.bindAndListen(PORT)
    > while 1:
    > try:
    > s.work()
    > except:
    > e = sys.exc_info()
    >
    > The problem is that when I send multiple requests they are queued and
    > processed one after the other. Is there some other method that will allow
    > me to process multiple request at the same time?
    >
    > Thank You
    >


    Check out this snippet look at the end for user comments to get a
    multi-threaded or forking version.

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549

    Hope this helps.

    Adonis
    Adonis, Feb 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kiwi
    Replies:
    2
    Views:
    502
    Logomachist
    Sep 18, 2003
  2. Etienne Posthumus
    Replies:
    1
    Views:
    1,104
    Roger Binns
    Apr 1, 2004
  3. Replies:
    1
    Views:
    388
  4. xkenneth

    View XMLRPC Requests/Responses?

    xkenneth, Oct 15, 2007, in forum: Python
    Replies:
    6
    Views:
    409
    Mark T
    Oct 16, 2007
  5. Phi!
    Replies:
    1
    Views:
    178
Loading...

Share This Page