Help with async xmlrpc design

D

David Hirschfield

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 calling server.request() via xml-rpc)
server places "request" on queue and returns a unique ID to the calling
client
client repeatedly asks server if the request with the given ID is
complete via server.isComplete(<id>)
server eventually completes processing request
client eventually gets an affirmative from server.isComplete(<id>) and then
client pulls results from server via server.fetchResults(<id>)

originally the client only made one request at a time, and each one was
processed and results fetched in order.

I want to change this so that the client can send multiple requests to
the server and have them processed in the background.
There are a lot of different approaches to that process, and I'd like
advice on the best way to go about it.

I could simply place the request checking and results fetching into a
thread or thread-pool so that the client can submit requests to some
kind of queue and the thread will handle submitting the requests from
that queue, checking for completion and fetching results.

Unfortunately, that would mean lots of calls to the server asking if
each of the requests is complete yet (if I submit 100 requests, I'll be
repeatedly making 100 "are you done yet?" calls). I want to avoid that,
so I thought there would be some way to submit the request and then hold
open the connection to the server and wait on the completion, but still
allow the server to do work.

Any advice on how to avoid polling the server over and over for request
completion, but also allowing the client to submit multiple requests
without waiting for each one to finish before submitting the next?

Thanks in advance!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top