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

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

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

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:
    629
    Logomachist
    Sep 18, 2003
  2. Watsh
    Replies:
    2
    Views:
    1,144
    Keith M. Corbett
    Nov 2, 2004
  3. Replies:
    1
    Views:
    518
  4. Mitko Haralanov
    Replies:
    0
    Views:
    454
    Mitko Haralanov
    Oct 15, 2009
  5. Phi!
    Replies:
    1
    Views:
    367
  6. Replies:
    1
    Views:
    242
    J. Gleixner
    Jul 10, 2007
  7. Robert S
    Replies:
    2
    Views:
    201
    Robert S
    Jul 23, 2006
  8. eholz1
    Replies:
    7
    Views:
    113
    Peter Michaux
    Dec 13, 2007
Loading...