Re: How to get success/failure in case of thread

Discussion in 'Python' started by vivek@cs.unipune.ernet.in, Jul 30, 2003.

  1. Guest

    I think I have asked the wrong question :-( . I think the question should be :

    How can I use multiple threads in SimpleXMLRPCServer ???

    I tried the following things:

    1. added a queue object in the handler class
    2. called the _dispatch mathod on a separate thread
    3. in the _dispatch method after getting the reqult put it in queue
    4. called another function that will send the response that was previously
    send by the dispatch method.

    But when I tried this it failed miserably :-(

    I even don't know whether I tried in the right direction or not ??

    Any help/pointers. ???

    TIA and Kind Regards
    Vivek Kumar
     
    , Jul 30, 2003
    #1
    1. Advertising

  2. Anand Pillai Guest

    If you can post some actual code here I could be of more help.

    Cheers
    ~Anand

    wrote in message news:<>...
    > I think I have asked the wrong question :-( . I think the question should be :
    >
    > How can I use multiple threads in SimpleXMLRPCServer ???
    >
    > I tried the following things:
    >
    > 1. added a queue object in the handler class
    > 2. called the _dispatch mathod on a separate thread
    > 3. in the _dispatch method after getting the reqult put it in queue
    > 4. called another function that will send the response that was previously
    > send by the dispatch method.
    >
    > But when I tried this it failed miserably :-(
    >
    > I even don't know whether I tried in the right direction or not ??
    >
    > Any help/pointers. ???
    >
    > TIA and Kind Regards
    > Vivek Kumar
     
    Anand Pillai, Jul 30, 2003
    #2
    1. Advertising

  3. Guest

    Sol : MultiThreaded XMLRPCServer was (Re: How to get success/failure in case of thread)

    > wrote in message news:<>...

    > > How can I use multiple threads in SimpleXMLRPCServer ???
    > >
    > > TIA and Kind Regards
    > > Vivek Kumar


    OK, so I was looking in the wrong direction. But it is not entirely my fault.
    There is no mention of ThreadingTCPServer in the Standard Python Documentation.
    There is only one line in documentation of SocketServer module like :

    "The solution is to create a separate process or thread to handle each request;
    the ForkingMixIn and ThreadingMixIn mix-in classes can be used to support
    asynchronous behaviour."

    But still there was no mention that some TCP or UDP server are already
    implemented there on these classes. Anyway, after reading the code in the
    SockerServer module and finding that there is already a ThreadingTCPServer
    available all other thing becomes very very easy.

    To implement the Threaded XMLRPCServer I just copied the code of
    SimpleXMLRPCServer into a new file and changed the SocketServer.TCPServer to
    SocketServer.ThreadingTCPServer. That is all I have done and now it is a
    multithreaded XMLRPCServer :).

    But I think that the Python Documentation (Library reference) should contain
    the documentation for all the modules provided with the standard Python
    distribution.

    Again a BIG THX for all you people's support and help

    Kind Regards
    Vivek Kumar
     
    , Jul 31, 2003
    #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. Replies:
    0
    Views:
    304
  2. tiewknvc9
    Replies:
    3
    Views:
    859
    Andrew Thompson
    Nov 15, 2006
  3. Andy B
    Replies:
    0
    Views:
    320
    Andy B
    Dec 24, 2007
  4. Replies:
    0
    Views:
    475
  5. Replies:
    2
    Views:
    345
Loading...

Share This Page