Making an asynchronous interface appear synchronous to mod_python users

Posted by Trey on Stack Overflow See other posts from Stack Overflow or by Trey
Published on 2010-04-26T22:10:43Z Indexed on 2010/04/26 22:13 UTC
Read the original article Hit count: 177

I have a Python-driven web interface powered by Apache 2.2 with mod_python and Python 2.4. I need to make an asynchronous process appear synchronous to users of this web interface.

When users access one module on this website:

  1. An external SOAP interface will be contacted with a unique identifier and will respond with a number N
  2. The external interface will respond asynchronously by contacting a SOAP server on my machine between 1 and 10 times (the number N tells us how many responses we will receive)

I need to somehow aggregate these responses and pass them to the original module which will display the information back to the user. The goal is to make the process appear synchronous to the user.

What is the best way to handle this synchronization issue? Is this something Twisted would be well-suited for?

I am not restricting myself to Python for the solution, though it is preferred because everything else on the server is in Python. I prefer a solution that is both scalable and will take a minimal amount of programming time (though I understand that these attributes are somewhat at odds).

© Stack Overflow or respective owner

Related posts about python

Related posts about mod-python