Event Machine
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.
Configuration
The following shows how to configure NoBrainer to use EventMachine:
Semantics
- All NoBrainer queries must be run within a Fiber.
- NoBrainer provides a
close()
method on returned cursors to cancel streams.
Example
A full example can be found in the recipes section.