Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Created August 3, 2010 21:31
Show Gist options
  • Save jfhbrook/507188 to your computer and use it in GitHub Desktop.
Save jfhbrook/507188 to your computer and use it in GitHub Desktop.
The basic DNode example in coffee-script.
#!/usr/bin/env coffee
# This one makes the call.
DNode: require 'dnode'
sys: require 'sys'
DNode.connect(6060, (remote) ->
remote.timesTen(5, (res) ->
sys.puts res )
)
#!/usr/bin/env coffee
# This one is the remote which answers the rmi.
DNode: require 'dnode'
sys: require 'sys'
DNode({timesTen: (n,f) -> f(n*10)}).listen(6060)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment