Method: Moneta::Adapters::Cassandra#store
- Defined in:
- lib/moneta/adapters/cassandra.rb
#store(key, value, options = {}) ⇒ Object
Store value with key
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/moneta/adapters/cassandra.rb', line 120 def store(key, value, = {}) _, wc = consistency() expires = expires_value() t = batch = @backend.batch do |batch| batch.add(@store_delete, arguments: [t, key]) batch.add(@store, arguments: [key, value, (expires || 0).to_i, t + 1]) end @backend.execute(batch, .merge(consistency: wc)) value end |