asynch I/O in external method question
Is there a way to hook into the asynchronous machinery of Zope/Zserver from within an external method. I have to process credit cards over a modem, which takes approximately 10 seconds per transaction, during which, whatever thread is executing the external method is blocked, waiting for a response from the credit card server. I suppose that this means that as soon as I have 7 credit cards being processed simultaneously, my Zope is going to stop responding. If I had a way to hook into the asynch machinery of zope, that thread could happily be servicing other requests while it waits. Is this possible? --sam -- -------------------------- Sam Gendler CTO, Impossible, Inc. 1222 State St. Suite 250 Santa Barbara, CA. 93101 p: 805-560-0508 f: 805-560-0608 c: 805-689-1191 e: sgendler@impossible.com
From: "Sam Gendler" <sgendler@impossible.com>
Is there a way to hook into the asynchronous machinery of Zope/Zserver from within an external method. I have to process credit cards over a modem, which takes approximately 10 seconds per transaction, during which, whatever thread is executing the external method is blocked, waiting for a response from the credit card server. I suppose that this means that as soon as I have 7 credit cards being processed simultaneously, my Zope is going to stop responding. If I had a way to hook into the asynch machinery of zope, that thread could happily be servicing other requests while it waits. Is this possible?
You could use Loren Staffords ZScheduler. It is based on original code and ideas from me, and allows you to have DTML executed by Zope independend of the current request. All you'd have to do is programatically create a ZEvent that fires right now, and redirect the client to a polling page that will check for a CC check ready status. See: http://www.zope.org/Members/lstaffor/ZScheduler Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | The Open Source Web Application Server ---------------------------------------------
"Martijn Pieters" wrote:
From: "Sam Gendler" <sgendler@impossible.com>
Is there a way to hook into the asynchronous machinery of Zope/Zserver from within an external method. I have to process credit cards over a modem, which takes approximately 10 seconds per transaction, during which, whatever thread is executing the external method is blocked, waiting for a response from the credit card server. I suppose that this means that as soon as I have 7 credit cards being processed simultaneously, my Zope is going to stop responding. If I had a way to hook into the asynch machinery of zope, that thread could happily be servicing other requests while it waits. Is this possible?
Make sure you actually need to do this. If you have seven simultaneous credit card transactions going on at once you have an awful lot of money passing through your system. You really, really want to be confident that you understand how your credit card processing works because if you make a mistake it will cost you a lot of money. -- Rupert G. Goldie, Senior Software Engineer rgg@ekorp.com
participants (3)
-
Martijn Pieters -
Rupert G. Goldie -
Sam Gendler