Discussion:
Threadsafety of Ruby client?
Christopher J. Bottaro
2015-02-18 16:57:17 UTC
Permalink
Is the Ruby client threadsafe? For example...

session = Cassandra.cluster.connect
Thread.new{ session.execute("select * from ks1.table1") }
Thread.new{ session.execute("select * from ks2.table2") }

Notice multiple threads accessing the same session object, and also notice
different keyspaces being queried in the CQL.

Will that code work? Thank you for the help.
Bulat Shakirzyanov
2015-02-18 17:01:01 UTC
Permalink
Hi Christopher,

Yes, noted in http://datastax.github.io/ruby-driver/features/#thread-safety,
the ruby driver is thread-safe, except for the result objects.

On Wed, Feb 18, 2015 at 8:57 AM, Christopher J. Bottaro <
Post by Christopher J. Bottaro
Is the Ruby client threadsafe? For example...
session = Cassandra.cluster.connect
Thread.new{ session.execute("select * from ks1.table1") }
Thread.new{ session.execute("select * from ks2.table2") }
Notice multiple threads accessing the same session object, and also notice
different keyspaces being queried in the CQL.
Will that code work? Thank you for the help.
--
Cheers,
Bulat Shakirzyanov | @avalanche123 <https://twitter.com/avalanche123>
Loading...