Using synchronous (blocking) code with Nevow
Hello everyone I have a library of Python scripts that I need to use with my upcoming web-application. Unfortunately, those scripts block; for example, some of the objects I need to construct take several seconds each to return an instance from __init__(). How can I still use that code inside Nevow? (Using a different web server instead of Twisted's is definitely an option, if it doesn't entail any significant disadvantages.) Xif
You'll probably have to put the code in a thread and use deferreds to make it appear asynch to the rest of your code. On Apr 4, 2005, at 2:41 PM, Xif wrote:
Hello everyone
I have a library of Python scripts that I need to use with my upcoming web-application.
Unfortunately, those scripts block; for example, some of the objects I need to construct take several seconds each to return an instance from __init__().
How can I still use that code inside Nevow?
(Using a different web server instead of Twisted's is definitely an option, if it doesn't entail any significant disadvantages.)
Xif
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On Apr 4, 2005 5:47 PM, orbitz@ezabel.com
You'll probably have to put the code in a thread and use deferreds to make it appear asynch to the rest of your code.
This seems to come up fairly often. Try searching the list for "synchronous" , "blocking", "threading", etc. Dave Cook
Is there a simple tutorial/howto that explains how exactly this is done?
I'm new to both Twisted and Nevow, and I'm mainly a web developer
with very little undestanding of what "threads" and "deferreds" are.
Xif
On Apr 5, 2005 2:47 AM, orbitz@ezabel.com
You'll probably have to put the code in a thread and use deferreds to make it appear asynch to the rest of your code.
On Apr 4, 2005, at 2:41 PM, Xif wrote:
Hello everyone
I have a library of Python scripts that I need to use with my upcoming web-application.
Unfortunately, those scripts block; for example, some of the objects I need to construct take several seconds each to return an instance from __init__().
How can I still use that code inside Nevow?
(Using a different web server instead of Twisted's is definitely an option, if it doesn't entail any significant disadvantages.)
Xif
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
See the threads how-to on the twisted website. On Apr 6, 2005, at 9:33 AM, Xif wrote:
Is there a simple tutorial/howto that explains how exactly this is done?
I'm new to both Twisted and Nevow, and I'm mainly a web developer with very little undestanding of what "threads" and "deferreds" are.
Xif
On Apr 5, 2005 2:47 AM, orbitz@ezabel.com
wrote: You'll probably have to put the code in a thread and use deferreds to make it appear asynch to the rest of your code.
On Apr 4, 2005, at 2:41 PM, Xif wrote:
Hello everyone
I have a library of Python scripts that I need to use with my upcoming web-application.
Unfortunately, those scripts block; for example, some of the objects I need to construct take several seconds each to return an instance from __init__().
How can I still use that code inside Nevow?
(Using a different web server instead of Twisted's is definitely an option, if it doesn't entail any significant disadvantages.)
Xif
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (3)
-
Dave Cook
-
orbitz@ezabel.com
-
Xif