Class: Kafka::PendingMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/pending_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, key, topic, partition, partition_key, create_time) ⇒ PendingMessage

Returns a new instance of PendingMessage.



5
6
7
8
9
10
11
12
13
# File 'lib/kafka/pending_message.rb', line 5

def initialize(value, key, topic, partition, partition_key, create_time)
  @value = value
  @key = key
  @topic = topic
  @partition = partition
  @partition_key = partition_key
  @create_time = create_time
  @bytesize = key.to_s.bytesize + value.to_s.bytesize
end

Instance Attribute Details

#bytesizeObject (readonly)

Returns the value of attribute bytesize.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def bytesize
  @bytesize
end

#create_timeObject (readonly)

Returns the value of attribute create_time.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def create_time
  @create_time
end

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def key
  @key
end

#partitionObject (readonly)

Returns the value of attribute partition.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def partition
  @partition
end

#partition_keyObject (readonly)

Returns the value of attribute partition_key.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def partition_key
  @partition_key
end

#topicObject (readonly)

Returns the value of attribute topic.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def topic
  @topic
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/kafka/pending_message.rb', line 3

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/kafka/pending_message.rb', line 15

def ==(other)
  @value == other.value &&
    @key == other.key &&
    @topic == other.topic &&
    @partition == other.partition &&
    @partition_key == other.partition_key &&
    @create_time == other.create_time &&
    @bytesize == other.bytesize
end