Class: Kafka::FFI::Topic

Inherits:
OpaquePointer show all
Defined in:
lib/kafka/ffi/topic.rb

Instance Attribute Summary

Attributes inherited from OpaquePointer

#pointer

Instance Method Summary collapse

Methods inherited from OpaquePointer

by_ref, from_native, inherited, #initialize, to_native

Constructor Details

This class inherits a constructor from Kafka::FFI::OpaquePointer

Instance Method Details

#destroyObject

Release the application’s hold on the backing topic in librdkafka.



26
27
28
29
30
# File 'lib/kafka/ffi/topic.rb', line 26

def destroy
  if !pointer.null?
    ::Kafka::FFI.rd_kafka_topic_destroy(self)
  end
end

#nameString

Retrieve the name of the topic

Returns:

  • (String)

    Name of the topic



10
11
12
# File 'lib/kafka/ffi/topic.rb', line 10

def name
  ::Kafka::FFI.rd_kafka_topic_name(self)
end

#seek(partition, offset, timeout: 1000) ⇒ Boolean

Seek consumer for topic_partition to offset.

Parameters:

  • partition (Integer)

    Partition to set offset for

  • offset (Integer)

    Absolute or logical offset

  • timeout (Integer) (defaults to: 1000)

    Maximum time to wait in milliseconds

Returns:

  • (Boolean)

    True when the consumer’s offset was changed



21
22
23
# File 'lib/kafka/ffi/topic.rb', line 21

def seek(partition, offset, timeout: 1000)
  ::Kafka::FFI.rd_kafka_seek(self, partition, offset, timeout)
end