Class: Racecar::Message

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/racecar/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rdkafka_message, retries_count: nil) ⇒ Message

Returns a new instance of Message.



11
12
13
14
# File 'lib/racecar/message.rb', line 11

def initialize(rdkafka_message, retries_count: nil)
  @rdkafka_message = rdkafka_message
  @retries_count   = retries_count
end

Instance Attribute Details

#retries_countObject (readonly)

Returns the value of attribute retries_count.



9
10
11
# File 'lib/racecar/message.rb', line 9

def retries_count
  @retries_count
end

Instance Method Details

#==(other) ⇒ Object



26
27
28
# File 'lib/racecar/message.rb', line 26

def ==(other)
  @rdkafka_message == other.instance_variable_get(:@rdkafka_message)
end

#create_timeObject



22
23
24
# File 'lib/racecar/message.rb', line 22

def create_time
  @rdkafka_message.timestamp
end

#valueObject



18
19
20
# File 'lib/racecar/message.rb', line 18

def value
  @rdkafka_message.payload
end