Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can pass functions around in your JSON.


That's pretty cool. Like an asynchronous functional version of Cocoa's Distributed Objects.

Are there ever problems with one side referencing objects that no longer exist on the other side?

I've run into these kinds of problems due to the lack of weak references in JavaScript. Hopefully a future version of JavaScript [1][2] will fix that.

[1] http://wiki.ecmascript.org/doku.php?id=strawman:weak_referen...

[2] http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps


Referencing objects isn't a problem since dnode doesn't do replication, it just makes copies, but referencing functions when the client disconnects can occasionally be bothersome. You do get a hook when the client disconnects:

    conn.on('end', fn)
so that helps. At browserling.com all of our backend and frontend spanning lots of processes over several servers is tied together with dnode, and we haven't had any big problems tracking references that I can think of.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: