Class: Exekutor::Internal::CLI::Manager::DefaultPidFileValue

Inherits:
DefaultOptionValue show all
Defined in:
lib/exekutor/internal/cli/manager.rb

Overview

The default value for the pid file

Instance Method Summary collapse

Methods inherited from DefaultOptionValue

#to_s, #value

Constructor Details

#initializeDefaultPidFileValue

Returns a new instance of DefaultPidFileValue.



306
307
308
# File 'lib/exekutor/internal/cli/manager.rb', line 306

def initialize
  super("tmp/pids/exekutor[.%{identifier}].pid")
end

Instance Method Details

#for_identifier(identifier) ⇒ String

Returns the path to the default pidfile of the worker with the specified identifier.

Parameters:

  • identifier (nil, String)

    the worker identifier

Returns:

  • (String)

    the path to the default pidfile of the worker with the specified identifier



312
313
314
315
316
317
318
# File 'lib/exekutor/internal/cli/manager.rb', line 312

def for_identifier(identifier)
  if identifier.nil? || identifier.empty? # rubocop:disable Rails/Blank – Rails is not loaded here
    "tmp/pids/exekutor.pid"
  else
    "tmp/pids/exekutor.#{identifier}.pid"
  end
end