In his paper
"Enforcing Strict Model-View Separation in Template Engines"
, Terence Parr defines and push and pull style templating as follows:
DEFINITION 8. A template uses the push strategy if all data
used by the template is computed prior to template evaluation and
is available as a set of attributes ai.
An example of a push-style templating system is
HTML::Template - there is no way to use a streaming iterator within a template. You have to stream all of the data and make it available as a parameter to the template.
DEFINITION 9. A template uses the pull strategy if any data
used by the template is computed on demand by invoking model
functions.
Template is an example of a pull-style templating system. You can freely invoke methods on objects or use iterated streams directly in the template.
my question/meditation
I have heard of people needing to stream large amounts of HTML data, around 1 gigabyte to respond to a single web request.
In that case, what would you do to avoid a timeout while streaming that data into a single memory location? Also, I can imagine a potential memory fault from being forced to pre-fetch an entire stream of data to satisfy push-style templating requirements.