Module: Luban::Deployment::Applications::Rack::WebServers::Thin::Common

Includes:
Cluster, Paths
Included in:
Luban::Deployment::Applications::Rack::WebServers::Thin
Defined in:
lib/luban/deployment/applications/rack/web_servers/thin.rb

Instance Method Summary collapse

Methods included from Paths

#control_file_extname, #pid_file_name, #pid_file_path, #socket_file_name, #socket_file_path

Methods included from Cluster

#monitor_command, #pid, #pid_file_exists?, #pid_file_pattern, #pid_files, #pid_files_path, #pids, #remove_orphaned_pid_file, #unmonitor_command

Instance Method Details

#default_web_server_optionsObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 88

def default_web_server_options
  @default_web_server_options ||= {
    # Server options
    address: "127.0.0.1",
    port: port + 1,
    socket: socket_file_path.to_s,
    chdir: release_path.to_s,
    environment: stage,
    # Daemon options
    daemonize: !dockerized?,
    log: log_file_path.to_s,
    pid: pid_file_path.to_s,
    tag: "#{env_name}:#{release_tag}",
    # Cluster options
    servers: 2,
    wait: 30,
    # Tuning options
    timeout: 30,
    max_conns: 1024,
    max_persistent_conns: 100,
    # Common options
    trace: true
  }
end

#process_patternObject



128
129
130
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 128

def process_pattern
  @process_pattern ||= "^thin server.+\\[#{Regexp.escape(env_name)}:.*\\]"
end

#start_commandObject



120
121
122
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 120

def start_command
  @start_command ||= bundle_command("#{thin_command} start")
end

#stop_commandObject



124
125
126
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 124

def stop_command
  @stop_command ||= bundle_command("#{thin_command} stop")
end

#tcp_socket?Boolean

Returns:

  • (Boolean)


113
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 113

def tcp_socket?; @tcp_socket; end

#thin_commandObject



116
117
118
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 116

def thin_command
  @thin_command ||= "thin -C #{control_file_path}"
end

#unix_socket?Boolean

Returns:

  • (Boolean)


114
# File 'lib/luban/deployment/applications/rack/web_servers/thin.rb', line 114

def unix_socket?; @unix_socket; end