Cassandra and EventMachine


I spent this past weekend adding eventmachine support for the Cassandra gem. We’re using Cassandra at OneSpot as our next-gen data store and need EM support. They were nice enough to pull my changes yesterday so the next release of the thrift_client and cassandra gems should work in EM. You just need to do this:

require 'thrift_client/event_machine' do do
        @twitter ='Twitter', "", :transport => Thrift::EventMachineTransport, :transport_wrapper => nil)

The key is the :transport and :transport_wrapper options which override the default, Socket-based implementation. Like all of my EventMachine code, this requires Ruby 1.9.