At the moment, the RethinkDB Ruby driver only supports EventMachine for asynchronous operations. NoBrainer supports EventMachine through the use of Ruby Fibers to keep its synchronous API semantics similarly to em-synchrony.
The following shows how to configure NoBrainer to use EventMachine:
- All NoBrainer queries must be run within a Fiber.
- NoBrainer provides a
close()method on returned cursors to cancel streams.
A full example can be found in the recipes section.