Class: Hatchet::HealthcheckConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hatchet/config.rb

Overview

Healthcheck configuration for worker health monitoring

Examples:

Enable healthcheck on custom port

healthcheck = HealthcheckConfig.new(enabled: true, port: 8080)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ HealthcheckConfig

Initialize healthcheck configuration

Parameters:

  • options (Hash)

    Healthcheck configuration options

Options Hash (**options):

  • :port (Integer)

    Port number for healthcheck endpoint (default: 8001)

  • :enabled (Boolean)

    Whether healthcheck is enabled (default: false)



74
75
76
77
# File 'lib/hatchet/config.rb', line 74

def initialize(**options)
  @port = parse_int(options[:port] || env_var("HATCHET_CLIENT_WORKER_HEALTHCHECK_PORT")) || 8001
  @enabled = parse_bool(options[:enabled] || env_var("HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED")) || false
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



67
# File 'lib/hatchet/config.rb', line 67

attr_reader :port, :enabled

#portInteger

Returns Port number for healthcheck endpoint.

Returns:

  • (Integer)

    Port number for healthcheck endpoint



67
68
69
# File 'lib/hatchet/config.rb', line 67

def port
  @port
end