Sha256: 4e28821035cc255c4da3780e2d22baf21dbbbab2a943f62cf0b6627fe19eeb8f
Contents?: true
Size: 1.18 KB
Versions: 42
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module Rdkafka class Consumer # Information about a partition, used in {TopicPartitionList}. class Partition # Partition number # @return [Integer] attr_reader :partition # Partition's offset # @return [Integer, nil] attr_reader :offset # Partition's error code # @return [Integer] attr_reader :err # @private def initialize(partition, offset, err = 0) @partition = partition @offset = offset @err = err end # Human readable representation of this partition. # @return [String] def to_s message = "<Partition #{partition}" message += " offset=#{offset}" if offset message += " err=#{err}" if err != 0 message += ">" message end # Human readable representation of this partition. # @return [String] def inspect to_s end # Whether another partition is equal to this # @return [Boolean] def ==(other) self.class == other.class && self.partition == other.partition && self.offset == other.offset end end end end
Version data entries
42 entries across 42 versions & 2 rubygems