puniverse/comsat — pull request #13 by circlespainter (2014-06-25 15:43:41+00:00)
Title: comsat-mongodb-allanbanks

Hi!

I implemented a mongodb integration module for comsat based on http://www.allanbank.com/mongodb-async-driver/index.html version 2.0 and a fairly complete essential testsuite for it based on Embed MongoDB https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo ; I think you might be interested in main comsat inclusion.

The module takes a subclassing approach, so existing code based on the driver should require minimal to no code changes. The overridden methods from the original driver are just the blocking and future ones in order to make them fiber-blocking. The fiber-blocking overrides are implemented by bridging the async, callback-based corresponding methods in the original driver through Quasar's FiberAsync.

I can think of further TODOs both for driver and tests but I think inclusion could be possible already (the 99 JUnit tests covering the overridden methods run all ok here); you can find those ideas in the classes' JavaDocs comments, but shortly:

- Test non-async suspendable methods (already declared in "suspendables"); anyway some are already used as part of test setup
- Test ListenableFuture functionality
- Add new fiber-blocking APIs for now async-only operations (with lock-in disadvantage for code starting to use them)
- Test new fiber-blocking APIs for now async-only operations

Incidentally (and luckily), starting with version 2.0, the license for the basic driver functionality has changed to Apache 2.0 http://www.allanbank.com/mongodb-async-driver/license.html which, to the extent of my knowledge, allows for liberal use even in commercial projects (previously commercial use required a commercial licence, which I think was a more strict policy than comsat's). Maybe the author decided such a change because of 10gen's OSS driver starting to consider/implement an async interface in the 3.0.x branch https://github.com/mongodb/mongo-java-driver/tree/3.0.x/async-driver