We run the python cassandra driver in production within a twisted app. We have not experimented with any of the non-default event loops (
cassandra.io), including the twisted reactor. Instead, we simply let the default cassandra driver run separately via threading. So basically:
```
def _session(d):
reactor.callFromThread(d.callback, Cluster(hosts).connect())
def get_session():
d = defer.Deferred()
reactor.callInThread(_session, d)
return d
def _future_to_deferred(future):
d = defer.Deferred()
future.add_callback(lambda result: reactor.callFromThread(d.callback, result))
future.add_errback(lambda error: reactor.callFromThread(d.errback, error))
return d
def query(session, cql):
return _future_to_deferred(session.execute_async(cql))
```
So that is functional -- whether it scales for your needs is another story. That default setup for us is generally bottlenecked on CPU, which issues are discussed in other threads (pun!) on the mailing list.
-Dana