class WaterDrop::Producer::Status

Producer lifecycle status object representation

Constants

LIFECYCLE

States in which the producer can be

Public Class Methods

new() click to toggle source

Creates a new instance of status with the initial state @return [Status]

# File lib/waterdrop/producer/status.rb, line 20
def initialize
  @current = LIFECYCLE.first
end

Public Instance Methods

active?() click to toggle source

@return [Boolean] true if producer is in a active state. Active means, that we can start

sending messages. Actives states are connected (connection established) or configured,
which means, that producer is configured, but connection with Kafka is
not yet established.
# File lib/waterdrop/producer/status.rb, line 28
def active?
  connected? || configured?
end
to_s() click to toggle source

@return [String] current status as a string

# File lib/waterdrop/producer/status.rb, line 33
def to_s
  @current.to_s
end