Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous lambda support #45

Open
juliangoacher opened this issue Aug 22, 2012 · 0 comments
Open

Asynchronous lambda support #45

juliangoacher opened this issue Aug 22, 2012 · 0 comments

Comments

@juliangoacher
Copy link

Consider adding asynchronous lambda support? It would work as follows:

  • Function values would support an optional callback argument.
  • Function values accepting the callback would return an undefined value and pass the template value at a later stage using the callback.
  • Function values will continue to work synchronously if they returning a value.

The solution would look like this:

var data = {
    value: function( body, cb ) {
        process.nextTick(function() {
            cb('result');
        });
    }
}

I've implemented a solution here: juliangoacher@599ea69

The solution will inspect the arity of a value function to try and avoid the situation where a function which doesn't accept the callback returns undefined and so hangs the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant