On 2/15/06, Matt Helm email@example.com wrote:
On 2/14/06, L. Daniel Burr firstname.lastname@example.org 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.
Twisted-web mailing list Twistedemail@example.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.