Class: CassandraModel::BatchReactor

Inherits:
BatchReactor::ReactorCluster
  • Object
show all
Defined in:
lib/cassandra_model/batch_reactor.rb,
lib/cassandra_model/batch_reactor/future.rb

Defined Under Namespace

Classes: Future

Instance Method Summary collapse

Constructor Details

#initialize(cluster, session, batch_klass, options) ⇒ BatchReactor

Returns a new instance of BatchReactor.



4
5
6
7
8
9
10
11
# File 'lib/cassandra_model/batch_reactor.rb', line 4

def initialize(cluster, session, batch_klass, options)
  @cluster = cluster
  @session = session
  @batch_klass = batch_klass

  define_partitioner(&method(:partition))
  super(cluster.hosts.count, options, &method(:batch_callback))
end

Instance Method Details

#perform_within_batch(statement) ⇒ Object



13
14
15
16
# File 'lib/cassandra_model/batch_reactor.rb', line 13

def perform_within_batch(statement)
  ione_future = super(statement)
  Future.new(ione_future)
end