[Twisted-Python] What is blocking code?

When I started coding I though I will just add the deferred calls where necessary later. Now it seems to me like I have to change the whole architecture of my app. I am running twisted as a Web-server to serve .rpy files. In these files I create quite complex html pages. In that process I also access a database. So when I tried to adapt to the adbapi I encountered proplems because: Starting from the .rpy file I call a method, which calls a method, ..., which calls a method, which eventually calls a method that queries the database. ->So where does my blocking code start? Is it just the last method that queries the db or is it the first one of the chain? ->Is there a way to make my db call deferred without reversing the whole method chain? ->Why don't I just make all the code in the .rpy deferred? Help very much appreciated. _stephan

On Wed, 3 Sep 2003 21:09:21 -0700 "stephan" <ccom@gmx.net> wrote:
When I started coding I though I will just add the deferred calls where necessary later. Now it seems to me like I have to change the whole architecture of my app.
Yes, event driven networking is that way. However, if you use woven, Deferreds will probably be handled transparently for you, making code a lot easier to write. Also you should note RPYs are intended for deployment of web applications, and not as a way of structuring code for your site. -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python & Twisted consulting
participants (2)
-
Itamar Shtull-Trauring
-
stephan