entrendipity/gremlin-node — pull request #24 by inolen (2013-10-08 02:34:45+00:00)
Title: Async support

So, to start, this is a really broad restructure of gremlin-node. I'm writing this in a bit of a hurry after reviewing https://github.com/entrendipity/gremlin-node/pull/22

Most notably:
* the exports of the module returns an object that you must new so that the Java runtime can be easily configured (e.g. to change the heap size)
* the global graph instance has been removed, the exported object now has a "wrap" method to allow you to wrap a transaction / graph instance (the wrapped graph object then supports V, v, E, e, etc. operations)
* added support for query() on the wrapped graph object. this query function returns a wrapped Java query object similar to the GremlinJSPipeline object.
* each pipeline instance now allocates its own bindings object, and when the global engine object evaluates a script it passes this bindings instance for context.
* bumped java dependency to 0.2.5. There was a nasty exception memory allocation leak I tracked down and has now been fixed in 0.2.5
* added .V and .VSync, .E, .ESync, etc. Some of the async functions there are stubbed as I didn't need them yet.

Some of the things I don't like still, which is why I've been sitting on this:
* while we don't need to make pipeline operations async (they do no I/O), it would be nice to encapsulate the potential exceptions thrown by Java when calling them, so that the user doesn't have to try / catch around them, and save these errors to be returned immediately returned when calling one of the async aggregate functions (e.g. `vertices`).
* implement .E, .e and .v (async versions)