wycats/handlebars.js — pull request #450 by evanvosberg (2013-02-24 02:07:21+00:00)
Title: Basic idea of asynchronous template processing.

# Async template processing

## Actually the implementation isn't finished.

By creating an issue it's not possible to add a commit of the implementation idea.
So I use this pull request for starting a discussion.

## Why?

Accessing additional data for template helpers or functions in the receiving template data is often asynchronous, especially in client side (in browser) template processing, it's hard to get all data access synchronous.

## How to?

### Use array buffer instead of string

I know using an array and join the strings decreases the performance, that's why async should be optional for the processing and compiling as well. So only async compiled templates are able to process async.

So we don't decrease the performance of default sync template processing.

### Additional createCallback param

Each template helper and data of type function get an additional param ```createCallback```. If the on the call method want to process async, it's required to call immediately the ```createCallback()``` method, this returns a callback method. For finishing the async helper process just call ```callback(result)``` with the results as first param.