Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: How to get success/failure in case of thread

Reply
Thread Tools

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

 
 
vivek@cs.unipune.ernet.in
Guest
Posts: n/a
 
      07-30-2003
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

 
Reply With Quote
 
 
 
 
Anand Pillai
Guest
Posts: n/a
 
      07-30-2003
If you can post some actual code here I could be of more help.

Cheers
~Anand

wrote in message news:<mailman.1059552864.3047.python->...
> 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

 
Reply With Quote
 
 
 
 
vivek@cs.unipune.ernet.in
Guest
Posts: n/a
 
      07-31-2003
> wrote in message news:<mailman.1059552864.3047.python->...

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
lower case to upper case Janice C Programming 17 12-14-2004 02:35 PM
how to case select with case-insensitive string ? Tee ASP .Net 3 06-23-2004 07:40 PM
Possible to turn on/off cookieless sessions dynamically on a case by case basis at run-time? Steve Franks ASP .Net 2 06-10-2004 02:04 PM
Scorsese Collection: Keep case vs Snap case Ray DVD Video 0 05-30-2004 04:04 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57