I would like to set up a server that takes XMLRPC requests and
processes them asynchronously. The XMLRPC server part is trivial in
python. The job processing part is the part that I am having trouble
with. I have been looking at how to use threadpool, but I can't see
how to get that working. I would like to have the XMLRPC part of
things do something like:
def method1(a,b,c):
jobid=workRequest(long_method1,[a,b,c])
return(jobid)
def method2(a,b,c):
jobid=workRequest(long_method2,[a,b,c])
return(jobid)
def long_method1(a,b,c)
do lots of heavy computation, etc.
store results in files in a given directory, etc
return result
..... for any number of methods
Again, pretty straightforward. However, I run into problems with the
threadpool and xmlrpc server both waiting. In particular, if I do
something like:
server = SimpleXMLRPCServer.SimpleXMLRPCServer(.....)
server.serve_forever()
Where can tell the threadpool that I have set up to wait
indefinitely? Both are blocking.
Thanks,
Sean 1 3129
Sean Davis wrote:
I would like to set up a server that takes XMLRPC requests and
processes them asynchronously. The XMLRPC server part is trivial in
python. The job processing part is the part that I am having trouble
with. I have been looking at how to use threadpool, but I can't see
how to get that working. I would like to have the XMLRPC part of
things do something like:
def method1(a,b,c):
jobid=workRequest(long_method1,[a,b,c])
return(jobid)
def method2(a,b,c):
jobid=workRequest(long_method2,[a,b,c])
return(jobid)
def long_method1(a,b,c)
do lots of heavy computation, etc.
store results in files in a given directory, etc
return result
.... for any number of methods
Again, pretty straightforward. However, I run into problems with the
threadpool and xmlrpc server both waiting. In particular, if I do
something like:
server = SimpleXMLRPCServer.SimpleXMLRPCServer(.....)
server.serve_forever()
Where can tell the threadpool that I have set up to wait
indefinitely? Both are blocking.
Thanks,
Sean
This site shows how to make it multi-threaded: http://aspn.activestate.com/ASPN/Coo.../Recipe/425043
But now you have to contend with the integrity of your data, provided
your going be storing data through these processes. You may want to look
into the Queue module to create a sort of message queue so your data can
be properly synchronized.
Hope this helps.
Adonis This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Passynkov, Vadim |
last post by:
I am using Asynchronous Query Processing interface from libpq library.
And I got some strange results on Solaris
My test select query is 'SELECT * from pg_user;'
and I use select system...
|
by: TS |
last post by:
Im in a web page and call an asynchronous method in business class. the call
back method is in the web page.
When page processes, it runs thru code begins invoking the method then the
page...
|
by: Viet |
last post by:
I have a couple of questions that hopefully someone could clarify for me. I
have an app that uses the threading.timer to constantly poll a scanner to
scan in documents. I understand that Async...
|
by: Simon Hart |
last post by:
Hi,
I thought I'd just open a thread in an attempt to get peoples feelers with
regards to multithreading vs Async Web Service processing.
Of course Web Services makes it easy to do Async...
|
by: Manfred Braun |
last post by:
Hi All,
I have a problem reading queue-messages async. My QueueReader has a Start()
and a Stop() method and if my app starts, it calls Start(). The problem is,
that there are possibly several...
|
by: David Hirschfield |
last post by:
I have an xmlrpc client/server system that works fine, but I want to
improve performance on the client side.
Right now the system operates like this:
client makes request from server (by...
|
by: half.italian |
last post by:
Hi,
I'm trying to serve up a simple XMLRPC server as a windows service. I
got it to run properly, I'm just not sure how to stop it properly.
Most of the documentation/examples I found for this...
|
by: Frankie |
last post by:
It appears that System.Random would provide an acceptable means through
which to generate a unique value used to identify multiple/concurrent
asynchronous tasks.
The usage of the value under...
|
by: Benjamin Grieshaber |
last post by:
Hi,
I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10)
I tried to compile php with xmlrpc support and got the following errors:
...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |