
On 2/15/06, Matt Helm code.name.eric@gmail.com wrote:
On 2/14/06, L. Daniel Burr ldanielburr@mac.com wrote:
Probably. Rendering your template in this way will most certainly block the reactor, since Cheetah templates don't support Deferreds. On the other hand, if the template is rendering *very* quickly, then this code might not block for long enough to actually matter.
That is what I suspected. I will call the Cheetah template in deferToThread.
Matt.
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Why not just compile your template at the head of the file using, Template.compile(file="path"). I did some experimentation with this, and it is very fast. Only time I could see where deferred would be useful is when you are compiling it initially, if you precompile your templates and dont call any blocking functions within it, it will be more than fast enough.
ToddB