Over a million developers have joined DZone.

Riaktor - Promise-Based Async API for Riak

· Database Zone

Sign up for the Couchbase Community Newsletter to stay ahead of the curve on the latest NoSQL news, events, and webinars. Brought to you in partnership with Couchbase.

Last week I released into OSS a library I’ve been hacking on for almost two years. It’s called Reactor and it’s a bit of a Frankenstein since it leverages the knowledge of 20 years of event-driven programming and tries to encapsulate Things That Just Work into an extremely lightweight and efficient asynchronous dispatching and coordinating framework. It’s based loosely on the Reactor design pattern but is also inspired by asynchronous frameworks, libraries, and other code developed in the last couple years.

One of the advantages of Reactor is that it provides a couple of abstractions for coordinating asynchronous actions. The Composable and Promise abstractions have lots of methods on them to compose non-blocking actions that should occur after the result is ready.

Riaktor is a simple helper library I wrote that wraps the official Basho Java client and makes it work asynchronously using the Reactor framework.

It won’t turn a Pinto into a Corevette. If your cluster can’t handle the 10’s of millions of events per second that Reactor can generate, then you’re not going to see an immediate benefit to using Riaktor. But if you’re running on a sufficiently large multi-core machine and are connecting to a sensibly-configured Riak cluster, then Riaktor can trade data with Riak as fast as you can shove it in (or pull it out).

It’s still alpha and basically in experimental stage. But it would be great to get some early feedback on it from any brave souls that want to try it out on their cluster.

https://github.com/jbrisbin/riaktor

Are you a developer? Don’t miss the monthly Couchbase Developer Community Newsletter, covering the latest headlines on NoSQL and much more. Brought to you in partnership with Couchbase.

Topics:

Published at DZone with permission of Jon Brisbin, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}