module Cassandra::TimestampGenerator

A generator is used to create client-timestamps (in the form of long integers) to send with C* requests when the `:client_timestamps` cluster option is set to true.

@abstract A timestamp generator given to {Cassandra.cluster} doesn't need to include this module, but needs to

implement the same methods. This module exists only for documentation purposes.

Public Instance Methods

next() click to toggle source

Create a new timestamp, as a 64-bit integer. Calls must return monotonically increasing values.

@return [Integer] an integer representing a timestamp in microseconds. @raise [NotImplementedError] if a class including this module does not define this method.

   # File lib/cassandra/timestamp_generator.rb
30 def next
31   raise NotImplementedError, "#{self.class} class must implement the 'next' method"
32 end