Re:Introducing NowJS or "How to make a chat server in 12 lin...
by substack on Saturday March 12, 2011 @12:44AM
(#2316135)
The solution I settled on for dnode is that a deep traversal finds all the functions in your argument list, pulls them out, and wraps them. This part of the protocol is a reusable module if you want to go with it:
It's written for continuation-passing style but it shouldn't be too hard to retrofit it for other call styles if you want to preserve explicit returns for instance.
https://github.com/substack/dnode-protocol
It's written for continuation-passing style but it shouldn't be too hard to retrofit it for other call styles if you want to preserve explicit returns for instance.