diff --git a/404.html b/404.html index c4d48e6..3fefaae 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - procodile 1.0.19 + procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master diff --git a/Procodile.html b/Procodile.html index ef6bf98..e2e5727 100644 --- a/Procodile.html +++ b/Procodile.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile - procodile 1.0.19 + Procodile - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -301,210 +301,210 @@

- + procodile.cr
- + procodile/app_determination.cr
- + procodile/cli.cr
- + procodile/commands/check_concurrency_command.cr
- + procodile/commands/console_command.cr
- + procodile/commands/exec_command.cr
- + procodile/commands/help_command.cr
- + procodile/commands/kill_command.cr
- + procodile/commands/log_command.cr
- + procodile/commands/reload_command.cr
- + procodile/commands/restart_command.cr
- + procodile/commands/run_command.cr
- + procodile/commands/start_command.cr
- + procodile/commands/status_command.cr
- + procodile/commands/stop_command.cr
- + procodile/config.cr
- + procodile/control_client.cr
- + procodile/control_server.cr
- + procodile/control_session.cr
- + procodile/error.cr
- + procodile/instance.cr
- + procodile/logger.cr
- + procodile/message.cr
- + procodile/process.cr
- + procodile/procfile_option.cr
- + procodile/signal_handler.cr
- + procodile/status_cli_output.cr
- + procodile/supervisor.cr
- + procodile/tcp_proxy.cr
- + procodile/version.cr @@ -601,7 +601,7 @@


- [View source] + [View source]
@@ -617,7 +617,7 @@


- [View source] + [View source]
@@ -633,7 +633,7 @@


- [View source] + [View source]
@@ -649,7 +649,7 @@


- [View source] + [View source]
diff --git a/Procodile/AppDetermination.html b/Procodile/AppDetermination.html index 047ff60..f448c21 100644 --- a/Procodile/AppDetermination.html +++ b/Procodile/AppDetermination.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::AppDetermination - procodile 1.0.19 + Procodile::AppDetermination - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -314,7 +314,7 @@

- + procodile/app_determination.cr @@ -425,7 +425,7 @@


- [View source] + [View source]
@@ -455,7 +455,7 @@


- [View source] + [View source]
@@ -471,7 +471,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI.html b/Procodile/CLI.html index e7effb4..0f3f612 100644 --- a/Procodile/CLI.html +++ b/Procodile/CLI.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI - procodile 1.0.19 + Procodile::CLI - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -339,91 +339,91 @@

- + procodile/cli.cr
- + procodile/commands/check_concurrency_command.cr
- + procodile/commands/console_command.cr
- + procodile/commands/exec_command.cr
- + procodile/commands/help_command.cr
- + procodile/commands/kill_command.cr
- + procodile/commands/log_command.cr
- + procodile/commands/reload_command.cr
- + procodile/commands/restart_command.cr
- + procodile/commands/run_command.cr
- + procodile/commands/start_command.cr
- + procodile/commands/status_command.cr
- + procodile/commands/stop_command.cr @@ -822,7 +822,7 @@


- [View source] + [View source]
@@ -850,7 +850,7 @@


- [View source] + [View source]
@@ -866,7 +866,7 @@


- [View source] + [View source]
@@ -882,7 +882,7 @@


- [View source] + [View source]
@@ -903,7 +903,7 @@


- [View source] + [View source]
@@ -931,7 +931,7 @@


- [View source] + [View source]
@@ -947,7 +947,7 @@


- [View source] + [View source]
@@ -963,7 +963,7 @@


- [View source] + [View source]
@@ -979,7 +979,7 @@


- [View source] + [View source]
@@ -995,7 +995,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/CheckConcurrencyCommand.html b/Procodile/CLI/CheckConcurrencyCommand.html index 95cd89f..7fe0080 100644 --- a/Procodile/CLI/CheckConcurrencyCommand.html +++ b/Procodile/CLI/CheckConcurrencyCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::CheckConcurrencyCommand - procodile 1.0.19 + Procodile::CLI::CheckConcurrencyCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/check_concurrency_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/ConsoleCommand.html b/Procodile/CLI/ConsoleCommand.html index 504c501..9d04279 100644 --- a/Procodile/CLI/ConsoleCommand.html +++ b/Procodile/CLI/ConsoleCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::ConsoleCommand - procodile 1.0.19 + Procodile::CLI::ConsoleCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/console_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/ExecCommand.html b/Procodile/CLI/ExecCommand.html index af3ac8f..d5f2ce4 100644 --- a/Procodile/CLI/ExecCommand.html +++ b/Procodile/CLI/ExecCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::ExecCommand - procodile 1.0.19 + Procodile::CLI::ExecCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/exec_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/HelpCommand.html b/Procodile/CLI/HelpCommand.html index 8b1306c..b2558c0 100644 --- a/Procodile/CLI/HelpCommand.html +++ b/Procodile/CLI/HelpCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::HelpCommand - procodile 1.0.19 + Procodile::CLI::HelpCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/help_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/KillCommand.html b/Procodile/CLI/KillCommand.html index cdc26a6..b9f4f08 100644 --- a/Procodile/CLI/KillCommand.html +++ b/Procodile/CLI/KillCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::KillCommand - procodile 1.0.19 + Procodile::CLI::KillCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/kill_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/LogCommand.html b/Procodile/CLI/LogCommand.html index 914e7fc..2957929 100644 --- a/Procodile/CLI/LogCommand.html +++ b/Procodile/CLI/LogCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::LogCommand - procodile 1.0.19 + Procodile::CLI::LogCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/log_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/ReloadCommand.html b/Procodile/CLI/ReloadCommand.html index 78d81fa..6f772ff 100644 --- a/Procodile/CLI/ReloadCommand.html +++ b/Procodile/CLI/ReloadCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::ReloadCommand - procodile 1.0.19 + Procodile::CLI::ReloadCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/reload_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/RestartCommand.html b/Procodile/CLI/RestartCommand.html index ce84f87..36acf1f 100644 --- a/Procodile/CLI/RestartCommand.html +++ b/Procodile/CLI/RestartCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::RestartCommand - procodile 1.0.19 + Procodile::CLI::RestartCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/restart_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/RunCommand.html b/Procodile/CLI/RunCommand.html index d317ed6..2a595c5 100644 --- a/Procodile/CLI/RunCommand.html +++ b/Procodile/CLI/RunCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::RunCommand - procodile 1.0.19 + Procodile::CLI::RunCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/run_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/StartCommand.html b/Procodile/CLI/StartCommand.html index 025e81e..c69a230 100644 --- a/Procodile/CLI/StartCommand.html +++ b/Procodile/CLI/StartCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::StartCommand - procodile 1.0.19 + Procodile::CLI::StartCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/start_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/StatusCommand.html b/Procodile/CLI/StatusCommand.html index 5825f02..a9c53eb 100644 --- a/Procodile/CLI/StatusCommand.html +++ b/Procodile/CLI/StatusCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::StatusCommand - procodile 1.0.19 + Procodile::CLI::StatusCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/status_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CLI/StopCommand.html b/Procodile/CLI/StopCommand.html index 5ecd760..38f8df7 100644 --- a/Procodile/CLI/StopCommand.html +++ b/Procodile/CLI/StopCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CLI::StopCommand - procodile 1.0.19 + Procodile::CLI::StopCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -315,7 +315,7 @@

- + procodile/commands/stop_command.cr @@ -380,7 +380,7 @@


- [View source] + [View source]
diff --git a/Procodile/CliCommand.html b/Procodile/CliCommand.html index 46facbf..8aefe0c 100644 --- a/Procodile/CliCommand.html +++ b/Procodile/CliCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CliCommand - procodile 1.0.19 + Procodile::CliCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/procfile_option.cr @@ -436,7 +436,7 @@


- [View source] + [View source]
@@ -480,7 +480,7 @@


- [View source] + [View source]
@@ -496,7 +496,7 @@


- [View source] + [View source]
diff --git a/Procodile/CliOptions.html b/Procodile/CliOptions.html index c659664..a1b4afa 100644 --- a/Procodile/CliOptions.html +++ b/Procodile/CliOptions.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::CliOptions - procodile 1.0.19 + Procodile::CliOptions - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/procfile_option.cr @@ -606,7 +606,7 @@


- [View source] + [View source]
@@ -636,7 +636,7 @@


- [View source] + [View source]
@@ -652,7 +652,7 @@


- [View source] + [View source]
@@ -668,7 +668,7 @@


- [View source] + [View source]
@@ -684,7 +684,7 @@


- [View source] + [View source]
@@ -700,7 +700,7 @@


- [View source] + [View source]
@@ -716,7 +716,7 @@


- [View source] + [View source]
@@ -732,7 +732,7 @@


- [View source] + [View source]
@@ -748,7 +748,7 @@


- [View source] + [View source]
@@ -764,7 +764,7 @@


- [View source] + [View source]
@@ -780,7 +780,7 @@


- [View source] + [View source]
@@ -796,7 +796,7 @@


- [View source] + [View source]
@@ -812,7 +812,7 @@


- [View source] + [View source]
@@ -828,7 +828,7 @@


- [View source] + [View source]
@@ -844,7 +844,7 @@


- [View source] + [View source]
@@ -860,7 +860,7 @@


- [View source] + [View source]
@@ -876,7 +876,7 @@


- [View source] + [View source]
@@ -892,7 +892,7 @@


- [View source] + [View source]
@@ -908,7 +908,7 @@


- [View source] + [View source]
@@ -924,7 +924,7 @@


- [View source] + [View source]
@@ -940,7 +940,7 @@


- [View source] + [View source]
@@ -956,7 +956,7 @@


- [View source] + [View source]
@@ -972,7 +972,7 @@


- [View source] + [View source]
@@ -988,7 +988,7 @@


- [View source] + [View source]
@@ -1004,7 +1004,7 @@


- [View source] + [View source]
@@ -1020,7 +1020,7 @@


- [View source] + [View source]
@@ -1036,7 +1036,7 @@


- [View source] + [View source]
@@ -1052,7 +1052,7 @@


- [View source] + [View source]
@@ -1068,7 +1068,7 @@


- [View source] + [View source]
@@ -1084,7 +1084,7 @@


- [View source] + [View source]
@@ -1100,7 +1100,7 @@


- [View source] + [View source]
@@ -1116,7 +1116,7 @@


- [View source] + [View source]
@@ -1132,7 +1132,7 @@


- [View source] + [View source]
@@ -1148,7 +1148,7 @@


- [View source] + [View source]
@@ -1164,7 +1164,7 @@


- [View source] + [View source]
@@ -1180,7 +1180,7 @@


- [View source] + [View source]
@@ -1196,7 +1196,7 @@


- [View source] + [View source]
@@ -1212,7 +1212,7 @@


- [View source] + [View source]
@@ -1228,7 +1228,7 @@


- [View source] + [View source]
@@ -1244,7 +1244,7 @@


- [View source] + [View source]
@@ -1260,7 +1260,7 @@


- [View source] + [View source]
diff --git a/Procodile/Config.html b/Procodile/Config.html index 621e8c3..0dfdee3 100644 --- a/Procodile/Config.html +++ b/Procodile/Config.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Config - procodile 1.0.19 + Procodile::Config - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/config.cr @@ -534,7 +534,7 @@


- [View source] + [View source]
@@ -564,7 +564,7 @@


- [View source] + [View source]
@@ -580,7 +580,7 @@


- [View source] + [View source]
@@ -596,7 +596,7 @@


- [View source] + [View source]
@@ -612,7 +612,7 @@


- [View source] + [View source]
@@ -628,7 +628,7 @@


- [View source] + [View source]
@@ -644,7 +644,7 @@


- [View source] + [View source]
@@ -660,7 +660,7 @@


- [View source] + [View source]
@@ -676,7 +676,7 @@


- [View source] + [View source]
@@ -692,7 +692,7 @@


- [View source] + [View source]
@@ -708,7 +708,7 @@


- [View source] + [View source]
@@ -724,7 +724,7 @@


- [View source] + [View source]
@@ -740,7 +740,7 @@


- [View source] + [View source]
@@ -756,7 +756,7 @@


- [View source] + [View source]
@@ -772,7 +772,7 @@


- [View source] + [View source]
@@ -788,7 +788,7 @@


- [View source] + [View source]
@@ -804,7 +804,7 @@


- [View source] + [View source]
@@ -820,7 +820,7 @@


- [View source] + [View source]
@@ -836,7 +836,7 @@


- [View source] + [View source]
@@ -852,7 +852,7 @@


- [View source] + [View source]
@@ -868,7 +868,7 @@


- [View source] + [View source]
@@ -884,7 +884,7 @@


- [View source] + [View source]
@@ -900,7 +900,7 @@


- [View source] + [View source]
@@ -916,7 +916,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlClient.html b/Procodile/ControlClient.html index 6498b15..a08f780 100644 --- a/Procodile/ControlClient.html +++ b/Procodile/ControlClient.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlClient - procodile 1.0.19 + Procodile::ControlClient - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/control_client.cr @@ -423,7 +423,7 @@


- [View source] + [View source]
@@ -451,7 +451,7 @@


- [View source] + [View source]
@@ -479,7 +479,7 @@


- [View source] + [View source]
@@ -495,7 +495,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlClientProcessStatus.html b/Procodile/ControlClientProcessStatus.html index 2f228c3..0d47a72 100644 --- a/Procodile/ControlClientProcessStatus.html +++ b/Procodile/ControlClientProcessStatus.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlClientProcessStatus - procodile 1.0.19 + Procodile::ControlClientProcessStatus - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -500,7 +500,7 @@


- [View source] + [View source]
@@ -516,7 +516,7 @@


- [View source] + [View source]
@@ -546,7 +546,7 @@


- [View source] + [View source]
@@ -576,7 +576,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlClientReplyForStatusCommand.html b/Procodile/ControlClientReplyForStatusCommand.html index d99c45a..a444058 100644 --- a/Procodile/ControlClientReplyForStatusCommand.html +++ b/Procodile/ControlClientReplyForStatusCommand.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlClientReplyForStatusCommand - procodile 1.0.19 + Procodile::ControlClientReplyForStatusCommand - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -525,7 +525,7 @@


- [View source] + [View source]
@@ -541,7 +541,7 @@


- [View source] + [View source]
@@ -585,7 +585,7 @@


- [View source] + [View source]
@@ -601,7 +601,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlServer.html b/Procodile/ControlServer.html index a8880ae..1c62e57 100644 --- a/Procodile/ControlServer.html +++ b/Procodile/ControlServer.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlServer - procodile 1.0.19 + Procodile::ControlServer - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/control_server.cr @@ -386,7 +386,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlSession.html b/Procodile/ControlSession.html index 06035a2..aca9d53 100644 --- a/Procodile/ControlSession.html +++ b/Procodile/ControlSession.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlSession - procodile 1.0.19 + Procodile::ControlSession - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/control_session.cr @@ -431,7 +431,7 @@


- [View source] + [View source]
@@ -461,7 +461,7 @@


- [View source] + [View source]
@@ -477,7 +477,7 @@


- [View source] + [View source]
@@ -493,7 +493,7 @@


- [View source] + [View source]
@@ -509,7 +509,7 @@


- [View source] + [View source]
@@ -525,7 +525,7 @@


- [View source] + [View source]
@@ -541,7 +541,7 @@


- [View source] + [View source]
@@ -557,7 +557,7 @@


- [View source] + [View source]
diff --git a/Procodile/ControlSessionData.html b/Procodile/ControlSessionData.html index 9a60e90..d5d880a 100644 --- a/Procodile/ControlSessionData.html +++ b/Procodile/ControlSessionData.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ControlSessionData - procodile 1.0.19 + Procodile::ControlSessionData - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -470,7 +470,7 @@


- [View source] + [View source]
@@ -486,7 +486,7 @@


- [View source] + [View source]
@@ -516,7 +516,7 @@


- [View source] + [View source]
@@ -532,7 +532,7 @@


- [View source] + [View source]
diff --git a/Procodile/Error.html b/Procodile/Error.html index 479afaf..083b952 100644 --- a/Procodile/Error.html +++ b/Procodile/Error.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Error - procodile 1.0.19 + Procodile::Error - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/error.cr diff --git a/Procodile/Instance.html b/Procodile/Instance.html index e1201e1..3a43a49 100644 --- a/Procodile/Instance.html +++ b/Procodile/Instance.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Instance - procodile 1.0.19 + Procodile::Instance - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/instance.cr @@ -597,7 +597,7 @@


- [View source] + [View source]
@@ -632,7 +632,7 @@


- [View source] + [View source]
@@ -654,7 +654,7 @@


- [View source] + [View source]
@@ -675,7 +675,7 @@


- [View source] + [View source]
@@ -696,7 +696,7 @@


- [View source] + [View source]
@@ -717,7 +717,7 @@


- [View source] + [View source]
@@ -738,7 +738,7 @@


- [View source] + [View source]
@@ -759,7 +759,7 @@


- [View source] + [View source]
@@ -775,7 +775,7 @@


- [View source] + [View source]
@@ -797,7 +797,7 @@


- [View source] + [View source]
@@ -813,7 +813,7 @@


- [View source] + [View source]
@@ -829,7 +829,7 @@


- [View source] + [View source]
@@ -850,7 +850,7 @@


- [View source] + [View source]
@@ -871,7 +871,7 @@


- [View source] + [View source]
@@ -887,7 +887,7 @@


- [View source] + [View source]
@@ -903,7 +903,7 @@


- [View source] + [View source]
@@ -924,7 +924,7 @@


- [View source] + [View source]
@@ -940,7 +940,7 @@


- [View source] + [View source]
@@ -956,7 +956,7 @@


- [View source] + [View source]
@@ -977,7 +977,7 @@


- [View source] + [View source]
@@ -998,7 +998,7 @@


- [View source] + [View source]
@@ -1019,7 +1019,7 @@


- [View source] + [View source]
@@ -1040,7 +1040,7 @@


- [View source] + [View source]
@@ -1061,7 +1061,7 @@


- [View source] + [View source]
@@ -1082,7 +1082,7 @@


- [View source] + [View source]
@@ -1104,7 +1104,7 @@


- [View source] + [View source]
@@ -1125,7 +1125,7 @@


- [View source] + [View source]
@@ -1146,7 +1146,7 @@


- [View source] + [View source]
@@ -1162,7 +1162,7 @@


- [View source] + [View source]
@@ -1183,7 +1183,7 @@


- [View source] + [View source]
@@ -1204,7 +1204,7 @@


- [View source] + [View source]
@@ -1225,7 +1225,7 @@


- [View source] + [View source]
diff --git a/Procodile/InstanceConfig.html b/Procodile/InstanceConfig.html index 92892e1..edd4c05 100644 --- a/Procodile/InstanceConfig.html +++ b/Procodile/InstanceConfig.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::InstanceConfig - procodile 1.0.19 + Procodile::InstanceConfig - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -485,7 +485,7 @@


- [View source] + [View source]
@@ -501,7 +501,7 @@


- [View source] + [View source]
@@ -531,7 +531,7 @@


- [View source] + [View source]
@@ -547,7 +547,7 @@


- [View source] + [View source]
diff --git a/Procodile/Message.html b/Procodile/Message.html index 065465e..43ee27d 100644 --- a/Procodile/Message.html +++ b/Procodile/Message.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Message - procodile 1.0.19 + Procodile::Message - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -301,7 +301,7 @@

- + procodile/message.cr @@ -364,7 +364,7 @@


- [View source] + [View source]
diff --git a/Procodile/Process.html b/Procodile/Process.html index 2560547..e08f6fa 100644 --- a/Procodile/Process.html +++ b/Procodile/Process.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Process - procodile 1.0.19 + Procodile::Process - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/process.cr @@ -598,7 +598,7 @@


- [View source] + [View source]
@@ -633,7 +633,7 @@


- [View source] + [View source]
@@ -649,7 +649,7 @@


- [View source] + [View source]
@@ -665,7 +665,7 @@


- [View source] + [View source]
@@ -681,7 +681,7 @@


- [View source] + [View source]
@@ -702,7 +702,7 @@


- [View source] + [View source]
@@ -723,7 +723,7 @@


- [View source] + [View source]
@@ -744,7 +744,7 @@


- [View source] + [View source]
@@ -766,7 +766,7 @@


- [View source] + [View source]
@@ -787,7 +787,7 @@


- [View source] + [View source]
@@ -808,7 +808,7 @@


- [View source] + [View source]
@@ -829,7 +829,7 @@


- [View source] + [View source]
@@ -845,7 +845,7 @@


- [View source] + [View source]
@@ -861,7 +861,7 @@


- [View source] + [View source]
@@ -883,7 +883,7 @@


- [View source] + [View source]
@@ -904,7 +904,7 @@


- [View source] + [View source]
@@ -920,7 +920,7 @@


- [View source] + [View source]
@@ -941,7 +941,7 @@


- [View source] + [View source]
@@ -957,7 +957,7 @@


- [View source] + [View source]
@@ -973,7 +973,7 @@


- [View source] + [View source]
@@ -994,7 +994,7 @@


- [View source] + [View source]
@@ -1015,7 +1015,7 @@


- [View source] + [View source]
@@ -1036,7 +1036,7 @@


- [View source] + [View source]
@@ -1057,7 +1057,7 @@


- [View source] + [View source]
@@ -1073,7 +1073,7 @@


- [View source] + [View source]
@@ -1089,7 +1089,7 @@


- [View source] + [View source]
@@ -1110,7 +1110,7 @@


- [View source] + [View source]
@@ -1135,7 +1135,7 @@


- [View source] + [View source]
@@ -1156,7 +1156,7 @@


- [View source] + [View source]
@@ -1177,7 +1177,7 @@


- [View source] + [View source]
diff --git a/Procodile/ProcessOption.html b/Procodile/ProcessOption.html index 7fb5190..4d694ac 100644 --- a/Procodile/ProcessOption.html +++ b/Procodile/ProcessOption.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ProcessOption - procodile 1.0.19 + Procodile::ProcessOption - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -560,7 +560,7 @@


- [View source] + [View source]
@@ -576,7 +576,7 @@


- [View source] + [View source]
@@ -606,7 +606,7 @@


- [View source] + [View source]
@@ -622,7 +622,7 @@


- [View source] + [View source]
@@ -638,7 +638,7 @@


- [View source] + [View source]
@@ -654,7 +654,7 @@


- [View source] + [View source]
@@ -670,7 +670,7 @@


- [View source] + [View source]
@@ -686,7 +686,7 @@


- [View source] + [View source]
@@ -702,7 +702,7 @@


- [View source] + [View source]
@@ -718,7 +718,7 @@


- [View source] + [View source]
@@ -734,7 +734,7 @@


- [View source] + [View source]
@@ -750,7 +750,7 @@


- [View source] + [View source]
@@ -766,7 +766,7 @@


- [View source] + [View source]
@@ -782,7 +782,7 @@


- [View source] + [View source]
@@ -798,7 +798,7 @@


- [View source] + [View source]
@@ -814,7 +814,7 @@


- [View source] + [View source]
@@ -830,7 +830,7 @@


- [View source] + [View source]
@@ -846,7 +846,7 @@


- [View source] + [View source]
@@ -862,7 +862,7 @@


- [View source] + [View source]
@@ -878,7 +878,7 @@


- [View source] + [View source]
@@ -894,7 +894,7 @@


- [View source] + [View source]
@@ -910,7 +910,7 @@


- [View source] + [View source]
@@ -926,7 +926,7 @@


- [View source] + [View source]
@@ -942,7 +942,7 @@


- [View source] + [View source]
@@ -958,7 +958,7 @@


- [View source] + [View source]
@@ -974,7 +974,7 @@


- [View source] + [View source]
@@ -990,7 +990,7 @@


- [View source] + [View source]
diff --git a/Procodile/ProcfileOption.html b/Procodile/ProcfileOption.html index af71261..7226682 100644 --- a/Procodile/ProcfileOption.html +++ b/Procodile/ProcfileOption.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::ProcfileOption - procodile 1.0.19 + Procodile::ProcfileOption - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -545,7 +545,7 @@


- [View source] + [View source]
@@ -561,7 +561,7 @@


- [View source] + [View source]
@@ -591,7 +591,7 @@


- [View source] + [View source]
@@ -607,7 +607,7 @@


- [View source] + [View source]
@@ -623,7 +623,7 @@


- [View source] + [View source]
@@ -639,7 +639,7 @@


- [View source] + [View source]
@@ -655,7 +655,7 @@


- [View source] + [View source]
@@ -671,7 +671,7 @@


- [View source] + [View source]
@@ -687,7 +687,7 @@


- [View source] + [View source]
@@ -703,7 +703,7 @@


- [View source] + [View source]
@@ -719,7 +719,7 @@


- [View source] + [View source]
@@ -735,7 +735,7 @@


- [View source] + [View source]
@@ -751,7 +751,7 @@


- [View source] + [View source]
@@ -767,7 +767,7 @@


- [View source] + [View source]
@@ -783,7 +783,7 @@


- [View source] + [View source]
@@ -799,7 +799,7 @@


- [View source] + [View source]
@@ -815,7 +815,7 @@


- [View source] + [View source]
@@ -831,7 +831,7 @@


- [View source] + [View source]
@@ -847,7 +847,7 @@


- [View source] + [View source]
@@ -863,7 +863,7 @@


- [View source] + [View source]
@@ -879,7 +879,7 @@


- [View source] + [View source]
@@ -895,7 +895,7 @@


- [View source] + [View source]
@@ -911,7 +911,7 @@


- [View source] + [View source]
@@ -927,7 +927,7 @@


- [View source] + [View source]
diff --git a/Procodile/RunOptions.html b/Procodile/RunOptions.html index eb0d784..937bfc0 100644 --- a/Procodile/RunOptions.html +++ b/Procodile/RunOptions.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::RunOptions - procodile 1.0.19 + Procodile::RunOptions - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/procfile_option.cr @@ -461,7 +461,7 @@


- [View source] + [View source]
@@ -491,7 +491,7 @@


- [View source] + [View source]
@@ -507,7 +507,7 @@


- [View source] + [View source]
@@ -523,7 +523,7 @@


- [View source] + [View source]
@@ -539,7 +539,7 @@


- [View source] + [View source]
@@ -555,7 +555,7 @@


- [View source] + [View source]
@@ -571,7 +571,7 @@


- [View source] + [View source]
@@ -587,7 +587,7 @@


- [View source] + [View source]
@@ -603,7 +603,7 @@


- [View source] + [View source]
@@ -619,7 +619,7 @@


- [View source] + [View source]
@@ -635,7 +635,7 @@


- [View source] + [View source]
@@ -651,7 +651,7 @@


- [View source] + [View source]
diff --git a/Procodile/SignalHandler.html b/Procodile/SignalHandler.html index de4d14a..10e928d 100644 --- a/Procodile/SignalHandler.html +++ b/Procodile/SignalHandler.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::SignalHandler - procodile 1.0.19 + Procodile::SignalHandler - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/signal_handler.cr @@ -445,7 +445,7 @@


- [View source] + [View source]
@@ -475,7 +475,7 @@


- [View source] + [View source]
@@ -491,7 +491,7 @@


- [View source] + [View source]
@@ -507,7 +507,7 @@


- [View source] + [View source]
@@ -523,7 +523,7 @@


- [View source] + [View source]
@@ -539,7 +539,7 @@


- [View source] + [View source]
diff --git a/Procodile/StatusCLIOutput.html b/Procodile/StatusCLIOutput.html index 2b54573..8580062 100644 --- a/Procodile/StatusCLIOutput.html +++ b/Procodile/StatusCLIOutput.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::StatusCLIOutput - procodile 1.0.19 + Procodile::StatusCLIOutput - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/status_cli_output.cr @@ -411,7 +411,7 @@


- [View source] + [View source]
@@ -441,7 +441,7 @@


- [View source] + [View source]
@@ -457,7 +457,7 @@


- [View source] + [View source]
@@ -473,7 +473,7 @@


- [View source] + [View source]
diff --git a/Procodile/Supervisor.html b/Procodile/Supervisor.html index 8373029..a653b76 100644 --- a/Procodile/Supervisor.html +++ b/Procodile/Supervisor.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::Supervisor - procodile 1.0.19 + Procodile::Supervisor - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/supervisor.cr @@ -496,7 +496,7 @@


- [View source] + [View source]
@@ -526,7 +526,7 @@


- [View source] + [View source]
@@ -542,7 +542,7 @@


- [View source] + [View source]
@@ -558,7 +558,7 @@


- [View source] + [View source]
@@ -574,7 +574,7 @@


- [View source] + [View source]
@@ -590,7 +590,7 @@


- [View source] + [View source]
@@ -606,7 +606,7 @@


- [View source] + [View source]
@@ -622,7 +622,7 @@


- [View source] + [View source]
@@ -638,7 +638,7 @@


- [View source] + [View source]
@@ -654,7 +654,7 @@


- [View source] + [View source]
@@ -670,7 +670,7 @@


- [View source] + [View source]
@@ -686,7 +686,7 @@


- [View source] + [View source]
@@ -702,7 +702,7 @@


- [View source] + [View source]
@@ -718,7 +718,7 @@


- [View source] + [View source]
@@ -734,7 +734,7 @@


- [View source] + [View source]
@@ -750,7 +750,7 @@


- [View source] + [View source]
@@ -766,7 +766,7 @@


- [View source] + [View source]
@@ -782,7 +782,7 @@


- [View source] + [View source]
@@ -798,7 +798,7 @@


- [View source] + [View source]
@@ -814,7 +814,7 @@


- [View source] + [View source]
@@ -830,7 +830,7 @@


- [View source] + [View source]
diff --git a/Procodile/SupervisorMessages.html b/Procodile/SupervisorMessages.html index f0e3208..e785a22 100644 --- a/Procodile/SupervisorMessages.html +++ b/Procodile/SupervisorMessages.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::SupervisorMessages - procodile 1.0.19 + Procodile::SupervisorMessages - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -317,7 +317,7 @@

- + procodile/procfile_option.cr @@ -475,7 +475,7 @@


- [View source] + [View source]
@@ -491,7 +491,7 @@


- [View source] + [View source]
@@ -521,7 +521,7 @@


- [View source] + [View source]
@@ -537,7 +537,7 @@


- [View source] + [View source]
diff --git a/Procodile/SupervisorOptions.html b/Procodile/SupervisorOptions.html index 73f52a1..fb7d760 100644 --- a/Procodile/SupervisorOptions.html +++ b/Procodile/SupervisorOptions.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::SupervisorOptions - procodile 1.0.19 + Procodile::SupervisorOptions - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/procfile_option.cr @@ -436,7 +436,7 @@


- [View source] + [View source]
@@ -466,7 +466,7 @@


- [View source] + [View source]
@@ -482,7 +482,7 @@


- [View source] + [View source]
diff --git a/Procodile/TCPProxy.html b/Procodile/TCPProxy.html index 81e5989..b5cf276 100644 --- a/Procodile/TCPProxy.html +++ b/Procodile/TCPProxy.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Procodile::TCPProxy - procodile 1.0.19 + Procodile::TCPProxy - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -303,7 +303,7 @@

- + procodile/tcp_proxy.cr @@ -438,7 +438,7 @@


- [View source] + [View source]
@@ -466,7 +466,7 @@


- [View source] + [View source]
@@ -494,7 +494,7 @@


- [View source] + [View source]
@@ -510,7 +510,7 @@


- [View source] + [View source]
@@ -526,7 +526,7 @@


- [View source] + [View source]
@@ -542,7 +542,7 @@


- [View source] + [View source]
@@ -558,7 +558,7 @@


- [View source] + [View source]
diff --git a/String.html b/String.html index fedc14b..e5661b1 100644 --- a/String.html +++ b/String.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - String - procodile 1.0.19 + String - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master @@ -411,7 +411,7 @@

- + procodile/color.cr @@ -506,7 +506,7 @@


- [View source] + [View source]
diff --git a/index.html b/index.html index fa0c874..25e56db 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - procodile 1.0.19 + procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master diff --git a/index.json b/index.json index 73c7b51..8c8076e 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -{"repository_name":"procodile","body":"# Procodile 🐊\n\nRunning & deploying Ruby apps to places like [Viaduct](https://viaduct.io) & Heroku is really easy but running processes on actual servers is less fun. Procodile aims to take some the stress out of running your Ruby/Rails apps and give you some of the useful process management features you get from the takes of the PaaS providers.\n\nProcodile is a bit like [Foreman](https://github.com/ddollar/foreman) but things are designed to run in the background (as well as the foreground if you prefer) and there's a supervisor which keeps an eye on your processes and will respawn them if they die.\n\nProcodile works out of the box with your existing `Procfile`.\n\n* [Watch a quick screencast](https://vimeo.com/188041935)\n* [Read documentation](https://github.com/adamcooke/procodile/wiki)\n* [View on RubyGems](https://rubygems.org/gems/procodile)\n* [Check the CHANGELOG](https://github.com/adamcooke/procodile/blob/master/CHANGELOG.md)\n\n![Screenshot](https://share.adam.ac/16/cAZRKUM7.png)\n","program":{"html_id":"procodile/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"procodile","program":true,"enum":false,"alias":false,"const":false,"constants":[{"id":"ORIGINAL_ARGV","name":"ORIGINAL_ARGV","value":"ARGV.join(\" \")"}],"types":[{"html_id":"procodile/Procodile","path":"Procodile.html","kind":"module","full_name":"Procodile","name":"Procodile","abstract":false,"locations":[{"filename":"src/procodile.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L6"},{"filename":"src/procodile/app_determination.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L3"},{"filename":"src/procodile/cli.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L6"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L1"},{"filename":"src/procodile/commands/console_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L1"},{"filename":"src/procodile/commands/exec_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L1"},{"filename":"src/procodile/commands/help_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L1"},{"filename":"src/procodile/commands/kill_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L1"},{"filename":"src/procodile/commands/log_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L1"},{"filename":"src/procodile/commands/reload_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L1"},{"filename":"src/procodile/commands/restart_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L1"},{"filename":"src/procodile/commands/run_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L1"},{"filename":"src/procodile/commands/start_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L1"},{"filename":"src/procodile/commands/status_command.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L4"},{"filename":"src/procodile/commands/stop_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L1"},{"filename":"src/procodile/config.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L3"},{"filename":"src/procodile/control_client.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L4"},{"filename":"src/procodile/control_server.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L4"},{"filename":"src/procodile/control_session.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L4"},{"filename":"src/procodile/error.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/error.cr#L1"},{"filename":"src/procodile/instance.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L3"},{"filename":"src/procodile/logger.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L3"},{"filename":"src/procodile/message.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L1"},{"filename":"src/procodile/process.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L3"},{"filename":"src/procodile/procfile_option.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L5"},{"filename":"src/procodile/signal_handler.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L1"},{"filename":"src/procodile/status_cli_output.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L3"},{"filename":"src/procodile/supervisor.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L8"},{"filename":"src/procodile/tcp_proxy.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L1"},{"filename":"src/procodile/version.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/version.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/procodile_cr/procodile_cr/src/procodile\\\"`).chomp.stringify }}"}],"class_methods":[{"html_id":"bin_path-class-method","name":"bin_path","abstract":false,"location":{"filename":"src/procodile.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L11"},"def":{"name":"bin_path","visibility":"Public","body":"File.join(root, \"bin\", \"procodile\")"}},{"html_id":"log(color,name,text)-class-method","name":"log","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"args_string":"(color, name, text)","args_html":"(color, name, text)","location":{"filename":"src/procodile/logger.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L8"},"def":{"name":"log","args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"visibility":"Public","body":"mutex.synchronize do\n text.to_s.lines.map(&.chomp).each do |message|\n output = \"\"\n output = output + (\"#{Time.local.to_s(\"%H:%M:%S\")} #{name.ljust(18, ' ')} | \".color(color))\n output = output + message\n STDOUT.puts(output)\n STDOUT.flush\n end\nend"}},{"html_id":"mutex:Mutex-class-method","name":"mutex","abstract":false,"location":{"filename":"src/procodile/logger.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L4"},"def":{"name":"mutex","return_type":"Mutex","visibility":"Public","body":"@@mutex || (@@mutex = Mutex.new)"}},{"html_id":"root-class-method","name":"root","abstract":false,"location":{"filename":"src/procodile.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L7"},"def":{"name":"root","visibility":"Public","body":"File.expand_path(\"..\", \"/home/runner/work/procodile_cr/procodile_cr/src\")"}}],"types":[{"html_id":"procodile/Procodile/AppDetermination","path":"Procodile/AppDetermination.html","kind":"class","full_name":"Procodile::AppDetermination","name":"AppDetermination","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/app_determination.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L7"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"doc":"\nThis class is responsible for determining which application should be used\n","summary":"

This class is responsible for determining which application should be used

","constructors":[{"html_id":"new(pwd:String,given_root:String|Nil,given_procfile:String|Nil,global_options=nil)-class-method","name":"new","doc":"Start by creating an determination ased on the root and procfile that has been provided\nto us by the user (from --root and/or --procfile)","summary":"

Start by creating an determination ased on the root and procfile that has been provided to us by the user (from --root and/or --procfile)

","abstract":false,"args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"args_string":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","args_html":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","location":{"filename":"src/procodile/app_determination.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L19"},"def":{"name":"new","args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(pwd, given_root, given_procfile, global_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"procfile:String?-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L15"},"def":{"name":"procfile","visibility":"Public","body":"@procfile"}},{"html_id":"root:String?-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L15"},"def":{"name":"root","visibility":"Public","body":"@root"}}]},{"html_id":"procodile/Procodile/CLI","path":"Procodile/CLI.html","kind":"class","full_name":"Procodile::CLI","name":"CLI","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/cli.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L7"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L2"},{"filename":"src/procodile/commands/console_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L2"},{"filename":"src/procodile/commands/exec_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L2"},{"filename":"src/procodile/commands/help_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L2"},{"filename":"src/procodile/commands/kill_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L2"},{"filename":"src/procodile/commands/log_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L2"},{"filename":"src/procodile/commands/reload_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L2"},{"filename":"src/procodile/commands/restart_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L2"},{"filename":"src/procodile/commands/run_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L2"},{"filename":"src/procodile/commands/start_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L2"},{"filename":"src/procodile/commands/status_command.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L5"},{"filename":"src/procodile/commands/stop_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COMMANDS","name":"COMMANDS","value":"[{:help, \"Shows this help output\"}, {:kill, \"Forcefully kill all known processes\"}, {:start, \"Starts processes and/or the supervisor\"}, {:stop, \"Stops processes and/or the supervisor\"}, {:exec, \"Execute a command within the environment\"}, {:run, \"Execute a command within the environment\"}, {:reload, \"Reload Procodile configuration\"}, {:check_concurrency, \"Check process concurrency\"}, {:log, \"Open/stream a Procodile log file\"}, {:restart, \"Restart processes\"}, {:status, \"Show the current status of processes\"}, {:console, \"Open a console within the environment\"}]"}],"included_modules":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"commands:Hash(String,CliCommand)-class-method","name":"commands","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L24"},"def":{"name":"commands","return_type":"Hash(String, CliCommand)","visibility":"Public","body":"@@commands || (@@commands = {} of String => CliCommand)"}},{"html_id":"options(name,&block:Proc(OptionParser,Procodile::CLI,Nil))-class-method","name":"options","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","args_html":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":30,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L30"},"def":{"name":"options","args":[{"name":"name","external_name":"name","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(OptionParser, Procodile::CLI, Nil)"},"visibility":"Public","body":"@@options[name] = block"}},{"html_id":"start_supervisor(config:Procodile::Config,options=Procodile::CliOptions.new,&block:Proc(Procodile::Supervisor,Nil))-class-method","name":"start_supervisor","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"args_string":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","args_html":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L66"},"def":{"name":"start_supervisor","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(Procodile::Supervisor, Nil)"},"visibility":"Public","body":"run_options = Procodile::RunOptions.new\nrun_options.respawn = options.respawn\nrun_options.stop_when_none = options.stop_when_none\nrun_options.proxy = options.proxy\nrun_options.force_single_log = options.foreground\nrun_options.port_allocations = options.port_allocations\ntidy_pids(config)\nif options.clean\n FileUtils.rm_rf(Dir[File.join(config.pid_root, \"*\")])\n puts(\"Emptied PID directory\")\nend\nif !Dir[File.join(config.pid_root, \"*\")].empty?\n raise(Error.new(\"The PID directory (#{config.pid_root}) is not empty. Cannot start unless things are clean.\"))\nend\nFile.write(\"/proc/self/comm\", \"[procodile] #{config.app_name} (#{config.root})\")\nif options.foreground\n File.write(config.supervisor_pid_path, ::Process.pid)\n (Supervisor.new(config, run_options)).start(block)\nelse\n FileUtils.rm_rf(File.join(config.pid_root, \"*.pid\"))\n process = ::Process.fork do\n log_path = File.open(config.log_path, \"a\")\n STDOUT.reopen(log_path)\n STDOUT.sync = true\n STDERR.reopen(log_path)\n STDERR.sync = true\n (Supervisor.new(config, run_options)).start(block)\n end\n spawn do\n process.wait\n end\n pid = process.pid\n File.write(config.supervisor_pid_path, pid)\n puts(\"Started Procodile supervisor with PID #{pid}\")\nend\n"}},{"html_id":"tidy_pids(config:Procodile::Config)-class-method","name":"tidy_pids","doc":"Clean up procodile.pid and procodile.sock with all unused pid files","summary":"

Clean up procodile.pid and procodile.sock with all unused pid files

","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":116,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L116"},"def":{"name":"tidy_pids","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"visibility":"Public","body":"FileUtils.rm_rf(config.supervisor_pid_path)\nFileUtils.rm_rf(config.sock_path)\npid_files = Dir[File.join(config.pid_root, \"*.pid\")]\npid_files.each do |pid_path|\n file_name = (pid_path.split(\"/\")).last\n pid = (File.read(pid_path)).to_i\n if ::Process.exists?(pid)\n puts(\"Could not remove #{file_name} because process (#{pid}) was active\")\n else\n FileUtils.rm_rf(pid_path)\n puts(\"Removed #{file_name} because process was not active\")\n end\nend\n"}}],"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L34"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"config=(config:Procodile::Config)-instance-method","name":"config=","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"config=","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"visibility":"Public","body":"@config = config"}},{"html_id":"dispatch(command)-instance-method","name":"dispatch","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command)","args_html":"(command)","location":{"filename":"src/procodile/cli.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L58"},"def":{"name":"dispatch","args":[{"name":"command","external_name":"command","restriction":""}],"visibility":"Public","body":"if self.class.commands.has_key?(command)\n self.class.commands[command].callable.call\nelse\n raise(Error.new(\"Invalid command '#{command}'\"))\nend"}},{"html_id":"options:Procodile::CliOptions-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::CliOptions)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"args_string":"(options : Procodile::CliOptions)","args_html":"(options : Procodile::CliOptions)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"visibility":"Public","body":"@options = options"}}],"types":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","path":"Procodile/CLI/CheckConcurrencyCommand.html","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"check_concurrency-instance-method","name":"check_concurrency","abstract":false,"location":{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L12"},"def":{"name":"check_concurrency","visibility":"Public","body":"if supervisor_running?\n reply = (ControlClient.run(@config.sock_path, \"check_concurrency\", reload: @options.reload)).as(NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)))\n if reply[\"started\"].empty? && reply[\"stopped\"].empty?\n puts(\"Processes are running as configured\")\n else\n reply[\"started\"].each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n reply[\"stopped\"].each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","path":"Procodile/CLI/ConsoleCommand.html","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/console_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"console-instance-method","name":"console","abstract":false,"location":{"filename":"src/procodile/commands/console_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L9"},"def":{"name":"console","visibility":"Public","body":"if (cmd = @config.console_command)\n exec(cmd)\nelse\n raise(Error.new(\"No console command has been configured in the Procfile\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ExecCommand","path":"Procodile/CLI/ExecCommand.html","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/exec_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"exec(command=nil)-instance-method","name":"exec","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/exec_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L9"},"def":{"name":"exec","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"desired_command = command || (ARGV[1..].join(\" \"))\nif (prefix = @config.exec_prefix)\n desired_command = \"#{prefix} #{desired_command}\"\nend\nif desired_command.empty?\n raise(Error.new(\"You need to specify a command to run (e.g. procodile run -- rake db:migrate)\"))\nelse\n environment = @config.environment_variables\n if ENV[\"PROCODILE_EXEC_QUIET\"]?.try(&.to_i) == 1\n else\n puts(\"Running with #{desired_command.color(33)}\")\n environment.each do |key, value|\n puts(\" #{key.color(34)} #{value}\")\n end\n end\n begin\n Dir.cd(@config.root)\n ::Process.exec(desired_command, env: environment, shell: true)\n rescue e : RuntimeError\n raise(Error.new(e.message))\n end\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/HelpCommand","path":"Procodile/CLI/HelpCommand.html","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/help_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"help-instance-method","name":"help","abstract":false,"location":{"filename":"src/procodile/commands/help_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L9"},"def":{"name":"help","visibility":"Public","body":"puts(\"\\e[45;37mWelcome to Procodile v#{Procodile::VERSION}\\e[0m\")\nputs(\"For documentation see https://adam.ac/procodile.\")\nputs\nputs(\"The following commands are supported:\")\nputs\nself.class.commands.to_a.sort_by do |x|\n x[0]\nend.to_h.each do |method, options|\n if options.description\n puts(\" \\e[34m#{method.to_s.ljust(18, ' ')}\\e[0m #{options.description}\")\n end\nend\nputs\nputs(\"For details for the options available for each command, use the --help option.\")\nputs(\"For example 'procodile start --help'.\")\n"}}]},{"html_id":"procodile/Procodile/CLI/KillCommand","path":"Procodile/CLI/KillCommand.html","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/kill_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"kill-instance-method","name":"kill","abstract":false,"location":{"filename":"src/procodile/commands/kill_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L9"},"def":{"name":"kill","visibility":"Public","body":"Dir[File.join(@config.pid_root, \"*.pid\")].each do |pid_path|\n name = (pid_path.split('/')).last.rstrip(\".pid\")\n pid = (File.read(pid_path)).to_i\n begin\n ::Process.signal(Signal::INT, pid)\n puts(\"Sent KILL to #{pid} (#{name})\")\n rescue RuntimeError\n end\n FileUtils.rm(pid_path)\nend"}}]},{"html_id":"procodile/Procodile/CLI/LogCommand","path":"Procodile/CLI/LogCommand.html","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/log_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"log-instance-method","name":"log","abstract":false,"location":{"filename":"src/procodile/commands/log_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L20"},"def":{"name":"log","visibility":"Public","body":"opts = [] of String\nif options.wait\n opts << \"-f\"\nend\nif options.lines\n opts << \"-n #{options.lines}\"\nend\nprocess = options.process\nif process\n if ( process = @config.processes[process])\n log_path = process.log_path\n else\n raise(Error.new(\"Invalid process name '#{process}'\"))\n end\nelse\n log_path = @config.log_path\nend\nif File.exists?(log_path)\n ::Process.exec(\"tail #{opts.join(' ')} #{log_path}\", shell: true)\nelse\n raise(Error.new(\"No file found at #{log_path}\"))\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/ReloadCommand","path":"Procodile/CLI/ReloadCommand.html","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/reload_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/commands/reload_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L9"},"def":{"name":"reload","visibility":"Public","body":"if supervisor_running?\n ControlClient.run(@config.sock_path, \"reload_config\")\n puts(\"Reloaded Procodile config\")\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RestartCommand","path":"Procodile/CLI/RestartCommand.html","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/restart_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"restart-instance-method","name":"restart","abstract":false,"location":{"filename":"src/procodile/commands/restart_command.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L16"},"def":{"name":"restart","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"restart\", processes: process_names_from_cli_option, tag: @options.tag)).as(Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)))\n if instances.empty?\n puts(\"There are no processes to restart.\")\n else\n instances.each do |old_instance, new_instance|\n if old_instance && new_instance\n if old_instance.description == new_instance.description\n puts((\"Restarted\".color(35)) + \" #{old_instance.description}\")\n else\n puts((\"Restarted\".color(35)) + \" #{old_instance.description} -> #{new_instance.description}\")\n end\n else\n if old_instance\n puts((\"Stopped\".color(31)) + \" #{old_instance.description}\")\n else\n if new_instance\n puts((\"Started\".color(32)) + \" #{new_instance.description}\")\n end\n end\n end\n STDOUT.flush\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RunCommand","path":"Procodile/CLI/RunCommand.html","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/run_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"run(command=nil)-instance-method","name":"run","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/run_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L9"},"def":{"name":"run","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"exec(command)"}}]},{"html_id":"procodile/Procodile/CLI/StartCommand","path":"Procodile/CLI/StartCommand.html","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/start_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/commands/start_command.cr","line_number":59,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L59"},"def":{"name":"start","visibility":"Public","body":"if supervisor_running?\n if @options.foreground\n raise(Error.new(\"Cannot be started in the foreground because supervisor already running\"))\n end\n if @options.respawn\n raise(Error.new(\"Cannot disable respawning because supervisor is already running\"))\n end\n if @options.stop_when_none\n raise(Error.new(\"Cannot stop supervisor when none running because supervisor is already running\"))\n end\n if @options.proxy\n raise(Error.new(\"Cannot enable the proxy when the supervisor is running\"))\n end\n instances = (ControlClient.run(@config.sock_path, \"start_processes\", processes: process_names_from_cli_option, tag: @options.tag, port_allocations: @options.port_allocations)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes to start.\")\n else\n instances.each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n if @options.start_supervisor == false\n raise(Error.new(\"Supervisor is not running and cannot be started because --no-supervisor is set\"))\n else\n self.class.start_supervisor(@config, @options) do |supervisor|\n if @options.start_processes == false\n else\n supervisor.start_processes(process_names_from_cli_option, SupervisorOptions.new(tag: @options.tag))\n end\n end\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StatusCommand","path":"Procodile/CLI/StatusCommand.html","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/status_command.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"status-instance-method","name":"status","abstract":false,"location":{"filename":"src/procodile/commands/status_command.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L23"},"def":{"name":"status","visibility":"Public","body":"if supervisor_running?\n status = (ControlClient.run(@config.sock_path, \"status\")).as(ControlClientReplyForStatusCommand)\n if @options.json\n puts(status.to_json)\n else\n if @options.json_pretty\n puts(status)\n nil\n else\n if @options.simple\n if status.messages.empty?\n message = status.instances.map do |p, i|\n \"#{p}[#{i.size}]\"\n end\n puts(\"OK || #{message.join(\", \")}\")\n else\n message = status.messages.map do |p|\n Message.parse(p)\n end.join(\", \")\n puts(\"Issues || #{message}\")\n end\n else\n (StatusCLIOutput.new(status)).print_all\n end\n end\n end\nelse\n if @options.simple\n puts(\"NotRunning || Procodile supervisor isn't running\")\n else\n raise(Error.new(\"Procodile supervisor isn't running\"))\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StopCommand","path":"Procodile/CLI/StopCommand.html","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/stop_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"stop-instance-method","name":"stop","abstract":false,"location":{"filename":"src/procodile/commands/stop_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L20"},"def":{"name":"stop","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"stop\", processes: process_names_from_cli_option, stop_supervisor: @options.stop_supervisor)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes were stopped.\")\n else\n instances.each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\n if @options.stop_supervisor\n puts(\"Supervisor will be stopped when processes are stopped.\")\n end\n if @options.wait_until_supervisor_stopped\n puts(\"Waiting for supervisor to stop...\")\n loop do\n sleep(1)\n if supervisor_running?\n sleep(1)\n else\n puts(\"Supervisor has stopped\")\n exit(0)\n end\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]}]},{"html_id":"procodile/Procodile/CliCommand","path":"Procodile/CliCommand.html","kind":"struct","full_name":"Procodile::CliCommand","name":"CliCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,description:String|Nil,options:Proc(OptionParser,Procodile::CLI,Nil)|Nil,callable:Proc(Nil))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"args_string":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","args_html":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, description, options, callable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"callable:Proc(Nil)-instance-method","name":"callable","abstract":false,"def":{"name":"callable","return_type":"Proc(Nil)","visibility":"Public","body":"@callable"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @description.clone, @options.clone, @callable.clone)"}},{"html_id":"copy_with(name_name=@name,description_description=@description,options_options=@options,callable_callable=@callable)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"args_string":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","args_html":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _description, _options, _callable)"}},{"html_id":"description:String|Nil-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String | ::Nil","visibility":"Public","body":"@description"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"options:Proc(OptionParser,Procodile::CLI,Nil)|Nil-instance-method","name":"options","abstract":false,"def":{"name":"options","return_type":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil","visibility":"Public","body":"@options"}}]},{"html_id":"procodile/Procodile/CliOptions","path":"Procodile/CliOptions.html","kind":"struct","full_name":"Procodile::CliOptions","name":"CliOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":70,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L70"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":92,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L92"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clean:Bool|Nil-instance-method","name":"clean","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean","return_type":"Bool | ::Nil","visibility":"Public","body":"@clean"}},{"html_id":"clean=(clean:Bool|Nil)-instance-method","name":"clean=","abstract":false,"args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"args_string":"(clean : Bool | Nil)","args_html":"(clean : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean=","args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@clean = clean"}},{"html_id":"development:Bool|Nil-instance-method","name":"development","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L87"},"def":{"name":"development","return_type":"Bool | ::Nil","visibility":"Public","body":"@development"}},{"html_id":"development=(development:Bool|Nil)-instance-method","name":"development=","abstract":false,"args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"args_string":"(development : Bool | Nil)","args_html":"(development : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L87"},"def":{"name":"development=","args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@development = development"}},{"html_id":"foreground:Bool|Nil-instance-method","name":"foreground","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground","return_type":"Bool | ::Nil","visibility":"Public","body":"@foreground"}},{"html_id":"foreground=(foreground:Bool|Nil)-instance-method","name":"foreground=","abstract":false,"args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"args_string":"(foreground : Bool | Nil)","args_html":"(foreground : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground=","args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@foreground = foreground"}},{"html_id":"json:Bool|Nil-instance-method","name":"json","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L82"},"def":{"name":"json","return_type":"Bool | ::Nil","visibility":"Public","body":"@json"}},{"html_id":"json=(json:Bool|Nil)-instance-method","name":"json=","abstract":false,"args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"args_string":"(json : Bool | Nil)","args_html":"(json : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L82"},"def":{"name":"json=","args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json = json"}},{"html_id":"json_pretty:Bool|Nil-instance-method","name":"json_pretty","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty","return_type":"Bool | ::Nil","visibility":"Public","body":"@json_pretty"}},{"html_id":"json_pretty=(json_pretty:Bool|Nil)-instance-method","name":"json_pretty=","abstract":false,"args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"args_string":"(json_pretty : Bool | Nil)","args_html":"(json_pretty : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty=","args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json_pretty = json_pretty"}},{"html_id":"lines:Int32|Nil-instance-method","name":"lines","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines","return_type":"Int32 | ::Nil","visibility":"Public","body":"@lines"}},{"html_id":"lines=(lines:Int32|Nil)-instance-method","name":"lines=","abstract":false,"args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"args_string":"(lines : Int32 | Nil)","args_html":"(lines : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines=","args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@lines = lines"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L90"},"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"process=(process:String|Nil)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"args_string":"(process : String | Nil)","args_html":"(process : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L90"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"visibility":"Public","body":"@process = process"}},{"html_id":"processes:String|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes","return_type":"String | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:String|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"args_string":"(processes : String | Nil)","args_html":"(processes : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"reload=(reload:Bool|Nil)-instance-method","name":"reload=","abstract":false,"args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(reload : Bool | Nil)","args_html":"(reload : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload=","args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@reload = reload"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"simple:Bool|Nil-instance-method","name":"simple","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple","return_type":"Bool | ::Nil","visibility":"Public","body":"@simple"}},{"html_id":"simple=(simple:Bool|Nil)-instance-method","name":"simple=","abstract":false,"args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"args_string":"(simple : Bool | Nil)","args_html":"(simple : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple=","args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@simple = simple"}},{"html_id":"start_processes:Bool|Nil-instance-method","name":"start_processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_processes"}},{"html_id":"start_processes=(start_processes:Bool|Nil)-instance-method","name":"start_processes=","abstract":false,"args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"args_string":"(start_processes : Bool | Nil)","args_html":"(start_processes : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes=","args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_processes = start_processes"}},{"html_id":"start_supervisor:Bool|Nil-instance-method","name":"start_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_supervisor"}},{"html_id":"start_supervisor=(start_supervisor:Bool|Nil)-instance-method","name":"start_supervisor=","abstract":false,"args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(start_supervisor : Bool | Nil)","args_html":"(start_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor=","args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_supervisor = start_supervisor"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"stop_supervisor=(stop_supervisor:Bool|Nil)-instance-method","name":"stop_supervisor=","abstract":false,"args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(stop_supervisor : Bool | Nil)","args_html":"(stop_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor=","args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_supervisor = stop_supervisor"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}},{"html_id":"tag=(tag:String|Nil)-instance-method","name":"tag=","abstract":false,"args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"args_string":"(tag : String | Nil)","args_html":"(tag : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag=","args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"visibility":"Public","body":"@tag = tag"}},{"html_id":"wait:Bool|Nil-instance-method","name":"wait","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait"}},{"html_id":"wait=(wait:Bool|Nil)-instance-method","name":"wait=","abstract":false,"args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"args_string":"(wait : Bool | Nil)","args_html":"(wait : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait=","args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait = wait"}},{"html_id":"wait_until_supervisor_stopped:Bool|Nil-instance-method","name":"wait_until_supervisor_stopped","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait_until_supervisor_stopped"}},{"html_id":"wait_until_supervisor_stopped=(wait_until_supervisor_stopped:Bool|Nil)-instance-method","name":"wait_until_supervisor_stopped=","abstract":false,"args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"args_string":"(wait_until_supervisor_stopped : Bool | Nil)","args_html":"(wait_until_supervisor_stopped : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped=","args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait_until_supervisor_stopped = wait_until_supervisor_stopped"}}]},{"html_id":"procodile/Procodile/Config","path":"Procodile/Config.html","kind":"class","full_name":"Procodile::Config","name":"Config","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/config.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COLORS","name":"COLORS","value":"[35, 31, 36, 32, 33, 34]","doc":"35 紫,31 红,36 青,32 绿,33 橘,34 蓝","summary":"

35 紫,31 红,36 青,32 绿,33 橘,34 蓝

"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(root:String,procfile:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(root : String, procfile : String | Nil = nil)","args_html":"(root : String, procfile : String | Nil = nil)","location":{"filename":"src/procodile/config.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L20"},"def":{"name":"new","args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(root, procfile)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":95,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L95"},"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name || (@app_name = (local_options.app_name || options.app_name) || \"Procodile\")"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":99,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L99"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"local_options.console_command || options.console_command"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L138"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"option_env = options.env || ({} of String => String)\nlocal_option_env = local_options.env || ({} of String => String)\noption_env.merge(local_option_env)\n"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":103,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L103"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"local_options.exec_prefix || options.exec_prefix"}},{"html_id":"loaded_at:Time?-instance-method","name":"loaded_at","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L18"},"def":{"name":"loaded_at","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options:ProcfileOption-instance-method","name":"local_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":119,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L119"},"def":{"name":"local_options","return_type":"ProcfileOption","visibility":"Public","body":"@local_options || (@local_options = load_local_options_from_file)"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":182,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L182"},"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.local\""}},{"html_id":"local_process_options:Hash(String,ProcessOption)-instance-method","name":"local_process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":127,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L127"},"def":{"name":"local_process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@local_process_options || (@local_process_options = local_options.processes || ({} of String => ProcessOption))"}},{"html_id":"log_path:String-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L152"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = local_options.log_path || options.log_path\nif log_path\n File.expand_path(log_path, self.root)\nelse\n if log_path.nil? && self.log_root\n File.join(self.log_root.not_nil!, \"procodile.log\")\n else\n File.expand_path(\"procodile.log\", self.root)\n end\nend\n"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":164,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L164"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"log_root = local_options.log_root || options.log_root\nif log_root\n File.expand_path(log_root, self.root)\nend\n"}},{"html_id":"options:ProcfileOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":115,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L115"},"def":{"name":"options","return_type":"ProcfileOption","visibility":"Public","body":"@options || (@options = load_options_from_file)"}},{"html_id":"options_for_process(name):ProcessOption-instance-method","name":"options_for_process","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name) : ProcessOption","args_html":"(name) : ProcessOption","location":{"filename":"src/procodile/config.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L131"},"def":{"name":"options_for_process","args":[{"name":"name","external_name":"name","restriction":""}],"return_type":"ProcessOption","visibility":"Public","body":"po = process_options[name]? || ProcessOption.new\nlocal_po = local_process_options[name]? || ProcessOption.new\npo.merge(local_po)\n"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":178,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L178"},"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.options\""}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":144,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L144"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"File.expand_path((local_options.pid_root || options.pid_root) || \"pids\", self.root)"}},{"html_id":"process_list:Hash(String,String)-instance-method","name":"process_list","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":111,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L111"},"def":{"name":"process_list","return_type":"Hash(String, String)","visibility":"Public","body":"@process_list || (@process_list = load_process_list_from_file)"}},{"html_id":"process_options:Hash(String,ProcessOption)-instance-method","name":"process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":123,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L123"},"def":{"name":"process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@process_options || (@process_options = options.processes || ({} of String => ProcessOption))"}},{"html_id":"processes:Hash(String,Procodile::Process)-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L107"},"def":{"name":"processes","return_type":"Hash(String, Procodile::Process)","visibility":"Public","body":"@processes || (@processes = {} of String => Procodile::Process)"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":174,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L174"},"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path || (File.join(self.root, \"Procfile\"))"}},{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":47,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L47"},"def":{"name":"reload","visibility":"Public","body":"@process_list = nil\n@options = nil\n@local_options = nil\n@process_options = nil\n@local_process_options = nil\n@loaded_at = nil\n@environment_variables = nil\nif (processes = @processes)\n process_list.each do |name, command|\n if ( process = processes[name]?)\n process.removed = false\n if process.command != command\n process.command = command\n Procodile.log(nil, \"system\", \"#{name} command has changed. Updated.\")\n end\n process.options = options_for_process(name)\n else\n Procodile.log(nil, \"system\", \"#{name} has been added to the Procfile.\")\n processes[name] = create_process(name, command, COLORS[(processes.size.divmod(COLORS.size))[1]])\n end\n end\n removed_processes = processes.keys - process_list.keys\n removed_processes.each do |process_name|\n if ( p = (processes[process_name]))\n p.removed = true\n processes.delete(process_name)\n Procodile.log(nil, \"system\", \"#{process_name} has been removed in the Procfile. It will be removed when it is stopped.\")\n end\n end\nend\n@loaded_at = Time.local\n"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L18"},"def":{"name":"root","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L170"},"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.sock\")"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":148,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L148"},"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.pid\")"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":91,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L91"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"local_options.user || options.user"}}]},{"html_id":"procodile/Procodile/ControlClient","path":"Procodile/ControlClient.html","kind":"class","full_name":"Procodile::ControlClient","name":"ControlClient","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_client.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"run(sock_path:String,command:String,**options)-class-method","name":"run","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"args_string":"(sock_path : String, command : String, **options)","args_html":"(sock_path : String, command : String, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L18"},"def":{"name":"run","args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"begin\n socket = self.new(sock_path)\n socket.run(command, **options)\nensure\n socket.try(&.disconnect)\nend"}}],"constructors":[{"html_id":"new(sock_path,block:Proc(ControlClient,Nil)|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"args_string":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","args_html":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","location":{"filename":"src/procodile/control_client.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L6"},"def":{"name":"new","args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(sock_path, block)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"disconnect-instance-method","name":"disconnect","abstract":false,"location":{"filename":"src/procodile/control_client.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L53"},"def":{"name":"disconnect","visibility":"Public","body":"@socket.try(&.close)"}},{"html_id":"run(command,**options)-instance-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command, **options)","args_html":"(command, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L25"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"@socket.puts(\"#{command} #{options.to_json}\")\nif (data = @socket.gets)\n code, reply = data.strip.split(/\\s+/, 2)\n if code.to_i == 200\n if reply && (!reply.empty?)\n case command\n when \"start_processes\", \"stop\"\n Array(InstanceConfig).from_json(reply)\n when \"restart\"\n Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)).from_json(reply)\n when \"check_concurrency\"\n NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)).from_json(reply)\n when \"status\"\n ControlClientReplyForStatusCommand.from_json(reply)\n end\n else\n true\n end\n else\n raise(Error.new(\"Error from control server: #{code} (#{reply.inspect})\"))\n end\nelse\n raise(Error.new(\"Control server disconnected.\"))\nend\n"}}]},{"html_id":"procodile/Procodile/ControlClientProcessStatus","path":"Procodile/ControlClientProcessStatus.html","kind":"struct","full_name":"Procodile::ControlClientProcessStatus","name":"ControlClientProcessStatus","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,log_color:Int32,quantity:Int32,max_respawns:Int32,respawn_window:Int32,command:String,restart_mode:Signal|String|Nil,log_path:String|Nil,removed:Bool,proxy_port:Int32|Nil,proxy_address:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","args_html":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, log_color, quantity, max_respawns, respawn_window, command, restart_mode, log_path, removed, proxy_port, proxy_address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":137,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L137"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @log_color.clone, @quantity.clone, @max_respawns.clone, @respawn_window.clone, @command.clone, @restart_mode.clone, @log_path.clone, @removed.clone, @proxy_port.clone, @proxy_address.clone)"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"def":{"name":"command","return_type":"String","visibility":"Public","body":"@command"}},{"html_id":"copy_with(name_name=@name,log_color_log_color=@log_color,quantity_quantity=@quantity,max_respawns_max_respawns=@max_respawns,respawn_window_respawn_window=@respawn_window,command_command=@command,restart_mode_restart_mode=@restart_mode,log_path_log_path=@log_path,removed_removed=@removed,proxy_port_proxy_port=@proxy_port,proxy_address_proxy_address=@proxy_address)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"args_string":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","args_html":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _log_color, _quantity, _max_respawns, _respawn_window, _command, _restart_mode, _log_path, _removed, _proxy_port, _proxy_address)"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"def":{"name":"log_color","return_type":"Int32","visibility":"Public","body":"@log_color"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","abstract":false,"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@max_respawns"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","abstract":false,"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@quantity"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"def":{"name":"removed","return_type":"Bool","visibility":"Public","body":"@removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","abstract":false,"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}}]},{"html_id":"procodile/Procodile/ControlClientReplyForStatusCommand","path":"Procodile/ControlClientReplyForStatusCommand.html","kind":"struct","full_name":"Procodile::ControlClientReplyForStatusCommand","name":"ControlClientReplyForStatusCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(version:String,messages:Array(SupervisorMessages),root:String,app_name:String,supervisor:NamedTuple(started_at:Int64,pid:Int64),instances:Hash(String,Array(InstanceConfig)),processes:Array(ControlClientProcessStatus),environment_variables:Hash(String,String),procfile_path:String,options_path:String,local_options_path:String,sock_path:String,supervisor_pid_path:String,pid_root:String,loaded_at:Int64,log_root:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","args_html":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"new","args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(version, messages, root, app_name, supervisor, instances, processes, environment_variables, procfile_path, options_path, local_options_path, sock_path, supervisor_pid_path, pid_root, loaded_at, log_root)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":167,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L167"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@version.clone, @messages.clone, @root.clone, @app_name.clone, @supervisor.clone, @instances.clone, @processes.clone, @environment_variables.clone, @procfile_path.clone, @options_path.clone, @local_options_path.clone, @sock_path.clone, @supervisor_pid_path.clone, @pid_root.clone, @loaded_at.clone, @log_root.clone)"}},{"html_id":"copy_with(version_version=@version,messages_messages=@messages,root_root=@root,app_name_app_name=@app_name,supervisor_supervisor=@supervisor,instances_instances=@instances,processes_processes=@processes,environment_variables_environment_variables=@environment_variables,procfile_path_procfile_path=@procfile_path,options_path_options_path=@options_path,local_options_path_local_options_path=@local_options_path,sock_path_sock_path=@sock_path,supervisor_pid_path_supervisor_pid_path=@supervisor_pid_path,pid_root_pid_root=@pid_root,loaded_at_loaded_at=@loaded_at,log_root_log_root=@log_root)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"args_string":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","args_html":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"copy_with","args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"visibility":"Public","body":"self.class.new(_version, _messages, _root, _app_name, _supervisor, _instances, _processes, _environment_variables, _procfile_path, _options_path, _local_options_path, _sock_path, _supervisor_pid_path, _pid_root, _loaded_at, _log_root)"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"@environment_variables"}},{"html_id":"instances:Hash(String,Array(InstanceConfig))-instance-method","name":"instances","abstract":false,"def":{"name":"instances","return_type":"Hash(String, Array(InstanceConfig))","visibility":"Public","body":"@instances"}},{"html_id":"loaded_at:Int64-instance-method","name":"loaded_at","abstract":false,"def":{"name":"loaded_at","return_type":"Int64","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"@local_options_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"@messages"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"@options_path"}},{"html_id":"pid_root:String-instance-method","name":"pid_root","abstract":false,"def":{"name":"pid_root","return_type":"String","visibility":"Public","body":"@pid_root"}},{"html_id":"processes:Array(ControlClientProcessStatus)-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(ControlClientProcessStatus)","visibility":"Public","body":"@processes"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"def":{"name":"root","return_type":"String","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"@sock_path"}},{"html_id":"supervisor:NamedTuple(started_at:Int64,pid:Int64)-instance-method","name":"supervisor","abstract":false,"def":{"name":"supervisor","return_type":"NamedTuple(started_at: Int64, pid: Int64)","visibility":"Public","body":"@supervisor"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"@supervisor_pid_path"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"procodile/Procodile/ControlServer","path":"Procodile/ControlServer.html","kind":"class","full_name":"Procodile::ControlServer","name":"ControlServer","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_server.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/control_server.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L6"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"begin\n sock_path = supervisor.config.sock_path\n spawn do\n server = UNIXServer.new(sock_path)\n Procodile.log(nil, \"control\", \"Listening at #{sock_path}\")\n loop do\n client = server.accept\n session = ControlSession.new(supervisor, client)\n while ( line = client.gets)\n if ( response = session.receive_data(line.strip))\n client.puts(response)\n end\n end\n client.close\n end\n end\nensure\n FileUtils.rm_rf(sock_path.not_nil!)\nend"}}]},{"html_id":"procodile/Procodile/ControlSession","path":"Procodile/ControlSession.html","kind":"class","full_name":"Procodile::ControlSession","name":"ControlSession","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_session.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,client:UNIXSocket)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"args_string":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","args_html":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","location":{"filename":"src/procodile/control_session.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L6"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, client)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"check_concurrency(options):String-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L55"},"def":{"name":"check_concurrency","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"result = @supervisor.check_concurrency(SupervisorOptions.new(reload: options.reload))\nresult = result.transform_values do |instances|\n instances.map(&.to_hash)\nend\n\"200 #{result.to_json}\"\n"}},{"html_id":"receive_data(data)-instance-method","name":"receive_data","abstract":false,"args":[{"name":"data","external_name":"data","restriction":""}],"args_string":"(data)","args_html":"(data)","location":{"filename":"src/procodile/control_session.cr","line_number":100,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L100"},"def":{"name":"receive_data","args":[{"name":"data","external_name":"data","restriction":""}],"visibility":"Public","body":"command, _options = data.split(/\\s+/, 2)\noptions = ControlSessionData.from_json(_options)\ncallable = {} of String => Proc(ControlSessionData, String)\ncallable[\"start_processes\"] = ->start_processes(ControlSessionData)\ncallable[\"stop\"] = ->stop(ControlSessionData)\ncallable[\"restart\"] = ->restart(ControlSessionData)\ncallable[\"reload_config\"] = ->reload_config(ControlSessionData)\ncallable[\"check_concurrency\"] = ->check_concurrency(ControlSessionData)\ncallable[\"status\"] = ->status(ControlSessionData)\nif callable[command]?\n begin\n callable[command].call(options)\n rescue e : Procodile::Error\n Procodile.log(nil, \"control\", \"Error: #{e.message}\".color(31))\n \"500 #{e.message}\"\n end\nelse\n \"404 Invaid command\"\nend\n"}},{"html_id":"reload_config(options):String-instance-method","name":"reload_config","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L49"},"def":{"name":"reload_config","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"@supervisor.reload_config\n\"200 []\"\n"}},{"html_id":"restart(options):String-instance-method","name":"restart","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":38,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L38"},"def":{"name":"restart","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.restart(SupervisorOptions.new(processes: options.processes, tag: options.tag))\n\"200 \" + instances.map do |a|\n a.map do |i|\n i ? i.to_hash : nil\n end\nend.to_json\n"}},{"html_id":"start_processes(options):String-instance-method","name":"start_processes","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L9"},"def":{"name":"start_processes","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"if options.port_allocations\n run_options_port_allocations = @supervisor.run_options.port_allocations\n if run_options_port_allocations\n run_options_port_allocations.merge!(options.port_allocations.not_nil!)\n else\n @supervisor.run_options.port_allocations = options.port_allocations\n end\nend\ninstances = @supervisor.start_processes(options.processes, SupervisorOptions.new(tag: options.tag))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}},{"html_id":"status(options):String-instance-method","name":"status","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L66"},"def":{"name":"status","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = {} of String => Array(Procodile::InstanceConfig)\n@supervisor.processes.each do |process, process_instances|\n instances[process.name] = [] of Procodile::InstanceConfig\n process_instances.each do |instance|\n instances[process.name] << instance.to_hash\n end\nend\nprocesses = @supervisor.processes.keys.map(&.to_hash)\nresult = ControlClientReplyForStatusCommand.new(version: Procodile::VERSION, messages: @supervisor.messages, root: @supervisor.config.root, app_name: @supervisor.config.app_name, supervisor: @supervisor.to_hash, instances: instances, processes: processes, environment_variables: @supervisor.config.environment_variables, procfile_path: @supervisor.config.procfile_path, options_path: @supervisor.config.options_path, local_options_path: @supervisor.config.local_options_path, sock_path: @supervisor.config.sock_path, log_root: @supervisor.config.log_root, supervisor_pid_path: @supervisor.config.supervisor_pid_path, pid_root: @supervisor.config.pid_root, loaded_at: @supervisor.config.loaded_at.not_nil!.to_unix)\n\"200 #{result.to_json}\"\n"}},{"html_id":"stop(options):String-instance-method","name":"stop","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L27"},"def":{"name":"stop","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.stop(SupervisorOptions.new(processes: options.processes, stop_supervisor: options.stop_supervisor))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}}]},{"html_id":"procodile/Procodile/ControlSessionData","path":"Procodile/ControlSessionData.html","kind":"struct","full_name":"Procodile::ControlSessionData","name":"ControlSessionData","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=[]ofString,tag:String|Nil=nil,port_allocations:Hash(String,Int32)|Nil=nil,reload:Bool|Nil=nil,stop_supervisor:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"new","args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, tag, port_allocations, reload, stop_supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":102,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L102"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @tag.clone, @port_allocations.clone, @reload.clone, @stop_supervisor.clone)"}},{"html_id":"copy_with(processes_processes=@processes,tag_tag=@tag,port_allocations_port_allocations=@port_allocations,reload_reload=@reload,stop_supervisor_stop_supervisor=@stop_supervisor)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"args_string":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","args_html":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _tag, _port_allocations, _reload, _stop_supervisor)"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Error","path":"Procodile/Error.html","kind":"class","full_name":"Procodile::Error","name":"Error","abstract":false,"superclass":{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/error.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/error.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"}},{"html_id":"procodile/Procodile/Instance","path":"Procodile/Instance.html","kind":"class","full_name":"Procodile::Instance","name":"Instance","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/instance.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,process:Procodile::Process,id:Int32)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"args_string":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","args_html":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","location":{"filename":"src/procodile/instance.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L17"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, process, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_respawn:Int32-instance-method","name":"add_respawn","doc":"\nIncrement the counter of respawns for this process\n","summary":"

Increment the counter of respawns for this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":356,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L356"},"def":{"name":"add_respawn","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif last_respawn && last_respawn < (Time.local - @process.respawn_window.seconds)\n @respawns = 1\nelse\n @last_respawn = Time.local\n @respawns = @respawns + 1\nend\n"}},{"html_id":"allocate_port(max_attempts=10)-instance-method","name":"allocate_port","doc":"\nFind a port number for this instance to listen on. We just check that nothing is already listening on it.\nThe process is expected to take it straight away if it wants it.\n","summary":"

Find a port number for this instance to listen on.

","abstract":false,"args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"args_string":"(max_attempts = 10)","args_html":"(max_attempts = 10)","location":{"filename":"src/procodile/instance.cr","line_number":389,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L389"},"def":{"name":"allocate_port","args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"visibility":"Public","body":"attempts = 0\nwhile !@port\n attempts = attempts + 1\n possible_port = rand(20000..29999)\n if self.port_available?(possible_port)\n Procodile.log(@process.log_color, description, \"Allocated port as #{possible_port}\")\n @port = possible_port\n else\n if attempts >= max_attempts\n raise(Procodile::Error.new(\"Couldn't allocate port for #{process.name}\"))\n end\n end\nend\n"}},{"html_id":"can_respawn?:Bool-instance-method","name":"can_respawn?","doc":"\nCan this process be respawned if needed?\n","summary":"

Can this process be respawned if needed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":336,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L336"},"def":{"name":"can_respawn?","return_type":"Bool","visibility":"Public","body":"(!stopping?) && (respawns + 1) <= @process.max_respawns"}},{"html_id":"check(options={}ofString=>String)-instance-method","name":"check","doc":"\nCheck the status of this process and handle as appropriate.\n","summary":"

Check the status of this process and handle as appropriate.

","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String)","args_html":"(options = {} of String => String)","location":{"filename":"src/procodile/instance.cr","line_number":303,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L303"},"def":{"name":"check","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"visibility":"Public","body":"if failed?\n return\nend\nif self.running?\n true\nelse\n if update_pid\n return check\n end\n if @supervisor.allow_respawning?\n if can_respawn?\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning...\")\n start\n add_respawn\n else\n if respawns >= @process.max_respawns\n Procodile.log(@process.log_color, description, \"\\e[41;37mWarning:\\e[0m\\e[31m this process has been respawned #{respawns} times and keeps dying.\\e[0m\")\n Procodile.log(@process.log_color, description, \"It will not be respawned automatically any longer and will no longer be managed.\".color(31))\n @failed = Time.local\n tidy\n end\n end\n else\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning not available.\")\n @failed = Time.local\n tidy\n end\nend\n"}},{"html_id":"description-instance-method","name":"description","doc":"\nReturn a description for this instance\n","summary":"

Return a description for this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":26,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L26"},"def":{"name":"description","visibility":"Public","body":"\"#{@process.name}.#{@id}\""}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn an array of environment variables that should be set\n","summary":"

Return an array of environment variables that should be set

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L57"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"vars = @process.environment_variables.merge({\"PROC_NAME\" => self.description, \"PID_FILE\" => self.pid_file_path, \"APP_ROOT\" => @process.config.root})\nif @port\n vars[\"PORT\"] = @port.to_s\nend\nvars\n"}},{"html_id":"failed?:Bool-instance-method","name":"failed?","doc":"\nHas this failed?\n","summary":"

Has this failed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":202,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L202"},"def":{"name":"failed?","return_type":"Bool","visibility":"Public","body":"@failed ? true : false"}},{"html_id":"id:Int32-instance-method","name":"id","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L15"},"def":{"name":"id","visibility":"Public","body":"@id"}},{"html_id":"on_stop-instance-method","name":"on_stop","doc":"\nA method that will be called when this instance has been stopped and it isn't going to be\nstarted again\n","summary":"

A method that will be called when this instance has been stopped and it isn't going to be started again

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":226,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L226"},"def":{"name":"on_stop","visibility":"Public","body":"@started_at = nil\n@stopped = true\ntidy\n"}},{"html_id":"pid:Int64-instance-method","name":"pid","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"pid","visibility":"Public","body":"@pid"}},{"html_id":"pid=(pid:Int64)-instance-method","name":"pid=","abstract":false,"args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"args_string":"(pid : Int64)","args_html":"(pid : Int64)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"pid=","args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"visibility":"Public","body":"@pid = pid"}},{"html_id":"pid_file_path:String-instance-method","name":"pid_file_path","doc":"\nReturn the path to this instance's PID file\n","summary":"

Return the path to this instance's PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L71"},"def":{"name":"pid_file_path","return_type":"String","visibility":"Public","body":"File.join(@process.config.pid_root, \"#{description}.pid\")"}},{"html_id":"pid_from_file:Int64|Nil-instance-method","name":"pid_from_file","doc":"\nReturn the PID that is in the instances process PID file\n","summary":"

Return the PID that is in the instances process PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L78"},"def":{"name":"pid_from_file","return_type":"Int64 | ::Nil","visibility":"Public","body":"if File.exists?(pid_file_path)\n pid = File.read(pid_file_path)\n pid.empty? ? nil : pid.strip.to_i64\nend"}},{"html_id":"port:Int32?-instance-method","name":"port","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"port","visibility":"Public","body":"@port"}},{"html_id":"port=(port:Int32|Nil)-instance-method","name":"port=","abstract":false,"args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"args_string":"(port : Int32 | Nil)","args_html":"(port : Int32 | Nil)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"port=","args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"@port = port"}},{"html_id":"port_available?(port):Bool-instance-method","name":"port_available?","doc":"\nIs the given port available?\n","summary":"

Is the given port available?

","abstract":false,"args":[{"name":"port","external_name":"port","restriction":""}],"args_string":"(port) : Bool","args_html":"(port) : Bool","location":{"filename":"src/procodile/instance.cr","line_number":408,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L408"},"def":{"name":"port_available?","args":[{"name":"port","external_name":"port","restriction":""}],"return_type":"Bool","visibility":"Public","body":"begin\n case @process.network_protocol\n when \"tcp\"\n server = TCPServer.new(\"127.0.0.1\", port)\n server.close\n true\n when \"udp\"\n server = UDPSocket.new\n server.bind(\"127.0.0.1\", port)\n server.close\n true\n else\n raise(Procodile::Error.new(\"Invalid network_protocol '#{@process.network_protocol}'\"))\n end\nrescue Socket::BindError\n false\nend"}},{"html_id":"process:Procodile::Process-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"process","visibility":"Public","body":"@process"}},{"html_id":"process=(process:Procodile::Process)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"args_string":"(process : Procodile::Process)","args_html":"(process : Procodile::Process)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"visibility":"Public","body":"@process = process"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","doc":"\nReturn the number of times this process has been respawned in the last hour\n","summary":"

Return the number of times this process has been respawned in the last hour

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":343,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L343"},"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif (@respawns.nil? || last_respawn.nil?) || last_respawn < (Time.local - @process.respawn_window.seconds)\n 0\nelse\n @respawns\nend\n"}},{"html_id":"restart:self|Nil-instance-method","name":"restart","doc":"\nRetarts the process using the appropriate method from the process configuration\n","summary":"

Retarts the process using the appropriate method from the process configuration

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":243,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L243"},"def":{"name":"restart","return_type":"self | ::Nil","visibility":"Public","body":"restart_mode = @process.restart_mode\nProcodile.log(@process.log_color, description, \"Restarting using #{restart_mode} mode\")\nupdate_pid\ncase restart_mode\nwhen Signal::USR1, Signal::USR2\n if running?\n ::Process.signal(restart_mode.as(Signal), @pid)\n if @supervisor.tag\n @tag = @supervisor.tag\n end\n Procodile.log(@process.log_color, description, \"Sent #{restart_mode.to_s.upcase} signal to process #{@pid}\")\n else\n Procodile.log(@process.log_color, description, \"Process not running already. Starting it.\")\n on_stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n new_instance.start\n end\n self\nwhen \"start-term\"\n new_instance = @process.create_instance(@supervisor)\n new_instance.start\n stop\n new_instance\nwhen \"term-start\"\n stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n spawn do\n while running?\n sleep(0.5)\n end\n new_instance.start\n end\n new_instance\nend\n"}},{"html_id":"running?:Bool-instance-method","name":"running?","doc":"\nIs this process running? Pass an option to check the given PID instead of the instance\n","summary":"

Is this process running? Pass an option to check the given PID instead of the instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L88"},"def":{"name":"running?","return_type":"Bool","visibility":"Public","body":"begin\n if ( pid = @pid)\n ::Process.pgid(pid) ? true : false\n else\n false\n end\nrescue RuntimeError\n false\nend"}},{"html_id":"should_be_running?:Bool-instance-method","name":"should_be_running?","doc":"\nShould this process be running?\n","summary":"

Should this process be running?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L50"},"def":{"name":"should_be_running?","return_type":"Bool","visibility":"Public","body":"!(stopped? || stopping?)"}},{"html_id":"start-instance-method","name":"start","doc":"\nStart a new instance of this process\n","summary":"

Start a new instance of this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":101,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L101"},"def":{"name":"start","visibility":"Public","body":"if stopping?\n Procodile.log(@process.log_color, description, \"Process is stopped/stopping therefore cannot be started again.\")\n return false\nend\nupdate_pid\nif running?\n Procodile.log(@process.log_color, description, \"Already running with PID #{@pid}\")\n nil\nelse\n port_allocations = @supervisor.run_options.port_allocations\n if port_allocations && (chosen_port = port_allocations[@process.name]?)\n if chosen_port == 0\n allocate_port\n else\n @port = chosen_port\n Procodile.log(@process.log_color, description, \"Assigned #{chosen_port} to process\")\n end\n else\n if @process.proxy? && @supervisor.tcp_proxy\n allocate_port\n else\n if (proposed_port = @process.allocate_port_from) && (@process.restart_mode != \"start-term\")\n process = @supervisor.processes[@process]\n allocated_ports = process ? process.select(&.running?).map(&.port) : [] of Int32\n while !@port\n if allocated_ports.includes?(proposed_port)\n else\n @port = proposed_port\n end\n proposed_port = proposed_port + 1\n end\n end\n end\n end\n if self.process.log_path && (@supervisor.run_options.force_single_log != true)\n FileUtils.mkdir_p(File.dirname(self.process.log_path))\n log_destination = File.open(self.process.log_path, \"a\")\n io = nil\n else\n reader, writer = IO.pipe\n log_destination = writer\n io = reader\n end\n if @supervisor.tag\n @tag = @supervisor.tag.dup\n end\n Dir.cd(@process.config.root)\n commands = @process.command.split(\" \")\n process = ::Process.new(command: commands[0], args: commands[1..], env: environment_variables, output: log_destination, error: log_destination)\n @pid = process.pid\n log_destination.close\n File.write(pid_file_path, \"#{@pid}\\n\")\n @supervisor.add_instance(self, io)\n spawn do\n process.wait\n end\n Procodile.log(@process.log_color, description, \"Started with PID #{@pid}\" + (@tag ? \" (tagged with #{@tag})\" : \"\"))\n if self.process.log_path && io.nil?\n Procodile.log(@process.log_color, description, \"Logging to #{self.process.log_path}\")\n end\n @started_at = Time.local\nend\n"}},{"html_id":"status:String-instance-method","name":"status","doc":"\nReturn the status of this instance\n","summary":"

Return the status of this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":33,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L33"},"def":{"name":"status","return_type":"String","visibility":"Public","body":"if stopped?\n \"Stopped\"\nelse\n if stopping?\n \"Stopping\"\n else\n if running?\n \"Running\"\n else\n if failed?\n \"Failed\"\n else\n \"Unknown\"\n end\n end\n end\nend"}},{"html_id":"stop-instance-method","name":"stop","doc":"\nSend this signal the signal to stop and mark the instance in a state that\ntells us that we want it to be stopped.\n","summary":"

Send this signal the signal to stop and mark the instance in a state that tells us that we want it to be stopped.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":210,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L210"},"def":{"name":"stop","visibility":"Public","body":"@stopping = Time.local\nupdate_pid\nif self.running?\n Procodile.log(@process.log_color, description, \"Sending #{@process.term_signal} to #{@pid}\")\n ::Process.signal(@process.term_signal, pid.not_nil!)\nelse\n Procodile.log(@process.log_color, description, \"Process already stopped\")\nend\n"}},{"html_id":"stopped?:Bool-instance-method","name":"stopped?","doc":"\nIs this stopped?\n","summary":"

Is this stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":195,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L195"},"def":{"name":"stopped?","return_type":"Bool","visibility":"Public","body":"@stopped || false"}},{"html_id":"stopping?:Bool-instance-method","name":"stopping?","doc":"\nIs this instance supposed to be stopping/be stopped?\n","summary":"

Is this instance supposed to be stopping/be stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":188,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L188"},"def":{"name":"stopping?","return_type":"Bool","visibility":"Public","body":"@stopping ? true : false"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L15"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tidy-instance-method","name":"tidy","doc":"\nTidy up when this process isn't needed any more\n","summary":"

Tidy up when this process isn't needed any more

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":235,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L235"},"def":{"name":"tidy","visibility":"Public","body":"FileUtils.rm_rf(self.pid_file_path)\nProcodile.log(@process.log_color, description, \"Removed PID file\")\n"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn this instance as a hash\n","summary":"

Return this instance as a hash

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":370,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L370"},"def":{"name":"to_hash","visibility":"Public","body":"started_at = @started_at\nInstanceConfig.new(description: self.description, pid: self.pid, respawns: self.respawns, status: self.status, running: self.running?, started_at: started_at ? started_at.to_unix : nil, tag: self.tag, port: @port)\n"}},{"html_id":"update_pid:Bool-instance-method","name":"update_pid","doc":"\nUpdate the locally cached PID from that stored on the file system.\n","summary":"

Update the locally cached PID from that stored on the file system.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":288,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L288"},"def":{"name":"update_pid","return_type":"Bool","visibility":"Public","body":"pid_from_file = self.pid_from_file\nif pid_from_file && (pid_from_file != @pid)\n @pid = pid_from_file\n @started_at = (File.info(self.pid_file_path)).modification_time\n Procodile.log(@process.log_color, description, \"PID file changed. Updated pid to #{@pid}\")\n true\nelse\n false\nend\n"}}]},{"html_id":"procodile/Procodile/InstanceConfig","path":"Procodile/InstanceConfig.html","kind":"struct","full_name":"Procodile::InstanceConfig","name":"InstanceConfig","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(description:String,pid:Int64|Nil,respawns:Int32,status:String,running:Bool,started_at:Int64|Nil,tag:String|Nil,port:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"args_string":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","args_html":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"new","args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(description, pid, respawns, status, running, started_at, tag, port)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":122,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L122"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@description.clone, @pid.clone, @respawns.clone, @status.clone, @running.clone, @started_at.clone, @tag.clone, @port.clone)"}},{"html_id":"copy_with(description_description=@description,pid_pid=@pid,respawns_respawns=@respawns,status_status=@status,running_running=@running,started_at_started_at=@started_at,tag_tag=@tag,port_port=@port)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"args_string":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","args_html":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"copy_with","args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"visibility":"Public","body":"self.class.new(_description, _pid, _respawns, _status, _running, _started_at, _tag, _port)"}},{"html_id":"description:String-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String","visibility":"Public","body":"@description"}},{"html_id":"pid:Int64|Nil-instance-method","name":"pid","abstract":false,"def":{"name":"pid","return_type":"Int64 | ::Nil","visibility":"Public","body":"@pid"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","abstract":false,"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"@respawns"}},{"html_id":"running:Bool-instance-method","name":"running","abstract":false,"def":{"name":"running","return_type":"Bool","visibility":"Public","body":"@running"}},{"html_id":"started_at:Int64|Nil-instance-method","name":"started_at","abstract":false,"def":{"name":"started_at","return_type":"Int64 | ::Nil","visibility":"Public","body":"@started_at"}},{"html_id":"status:String-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String","visibility":"Public","body":"@status"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Message","path":"Procodile/Message.html","kind":"module","full_name":"Procodile::Message","name":"Message","abstract":false,"locations":[{"filename":"src/procodile/message.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"parse(message)-class-method","name":"parse","abstract":false,"args":[{"name":"message","external_name":"message","restriction":""}],"args_string":"(message)","args_html":"(message)","location":{"filename":"src/procodile/message.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L3"},"def":{"name":"parse","args":[{"name":"message","external_name":"message","restriction":""}],"visibility":"Public","body":"case message.type\nwhen \"not_running\"\n \"#{message.instance} is not running (#{message.status})\"\nwhen \"incorrect_quantity\"\n \"#{message.process} only has #{message.current} instances (should have #{message.desired})\"\nend"}}]},{"html_id":"procodile/Procodile/Process","path":"Procodile/Process.html","kind":"class","full_name":"Procodile::Process","name":"Process","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/process.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MUTEX","name":"MUTEX","value":"Mutex.new"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,name:String,command:String,options:Procodile::ProcessOption=ProcessOption.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","args_html":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","location":{"filename":"src/procodile/process.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L16"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, name, command, options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","doc":"\nReturn the first port that ports should be allocated from for this process\n","summary":"

Return the first port that ports should be allocated from for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":124,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L124"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@options.allocate_port_from"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"command","visibility":"Public","body":"@command"}},{"html_id":"command=(command:String)-instance-method","name":"command=","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"::String"}],"args_string":"(command : String)","args_html":"(command : String)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"command=","args":[{"name":"command","external_name":"command","restriction":"::String"}],"visibility":"Public","body":"@command = command"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"correct_quantity?(quantity)-instance-method","name":"correct_quantity?","doc":"\nIs the given quantity suitable for this process?\n","summary":"

Is the given quantity suitable for this process?

","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":""}],"args_string":"(quantity)","args_html":"(quantity)","location":{"filename":"src/procodile/process.cr","line_number":198,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L198"},"def":{"name":"correct_quantity?","args":[{"name":"quantity","external_name":"quantity","restriction":""}],"visibility":"Public","body":"if self.restart_mode == \"start-term\"\n quantity >= self.quantity\nelse\n self.quantity == quantity\nend"}},{"html_id":"create_instance(supervisor):Instance-instance-method","name":"create_instance","doc":"\nCreate a new instance\n","summary":"

Create a new instance

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor) : Instance","args_html":"(supervisor) : Instance","location":{"filename":"src/procodile/process.cr","line_number":166,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L166"},"def":{"name":"create_instance","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"return_type":"Instance","visibility":"Public","body":"Instance.new(supervisor, self, get_instance_id)"}},{"html_id":"default_log_file_name:String-instance-method","name":"default_log_file_name","doc":"\nReturn the defualt log file name\n","summary":"

Return the defualt log file name

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L86"},"def":{"name":"default_log_file_name","return_type":"String","visibility":"Public","body":"@options.log_file_name || \"#{@name}.log\""}},{"html_id":"default_log_path:String-instance-method","name":"default_log_path","doc":"\nReturn the log path for this process if no log path is provided and split logs\nis enabled\n","summary":"

Return the log path for this process if no log path is provided and split logs is enabled

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":94,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L94"},"def":{"name":"default_log_path","return_type":"String","visibility":"Public","body":"if (lr = @config.log_root)\n File.join(lr, default_log_file_name)\nelse\n File.join(@config.root, default_log_file_name)\nend"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn all environment variables for this process\n","summary":"

Return all environment variables for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L34"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"global_variables = @config.environment_variables\nprocess_vars = if (process = @config.process_options[@name]?)\n process.env || ({} of String => String)\nelse\n {} of String => String\nend\nprocess_local_vars = if (local_process = @config.local_process_options[@name]?)\n local_process.env || ({} of String => String)\nelse\n {} of String => String\nend\nglobal_variables.merge(process_vars.merge(process_local_vars))\n"}},{"html_id":"generate_instances(supervisor,quantity=self.quantity):Array(Procodile::Instance)-instance-method","name":"generate_instances","doc":"\nGenerate an array of new instances for this process (based on its quantity)\n","summary":"

Generate an array of new instances for this process (based on its quantity)

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"args_string":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","args_html":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","location":{"filename":"src/procodile/process.cr","line_number":159,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L159"},"def":{"name":"generate_instances","args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"Array.new(quantity) do\n create_instance(supervisor)\nend"}},{"html_id":"get_instance_id:Int32-instance-method","name":"get_instance_id","doc":"\nIncrease the instance index and return\n","summary":"

Increase the instance index and return

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L24"},"def":{"name":"get_instance_id","return_type":"Int32","visibility":"Public","body":"MUTEX.synchronize do\n if @instance_index == 10000\n @instance_index = 0\n end\n @instance_index = @instance_index + 1\nend"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"log_color","visibility":"Public","body":"@log_color"}},{"html_id":"log_color=(log_color:Int32)-instance-method","name":"log_color=","abstract":false,"args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"args_string":"(log_color : Int32)","args_html":"(log_color : Int32)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"log_color=","args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"visibility":"Public","body":"@log_color = log_color"}},{"html_id":"log_path:String-instance-method","name":"log_path","doc":"\nReturn the path where log output for this process should be written to. If\nnone, output will be written to the supervisor log.\n","summary":"

Return the path where log output for this process should be written to.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L77"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = @options.log_path\nlog_path ? File.expand_path(log_path, @config.root) : default_log_path\n"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","doc":"\nThe maximum number of times this process can be respawned in the given period\n","summary":"

The maximum number of times this process can be respawned in the given period

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":62,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L62"},"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@options.max_respawns || 5"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L13"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"network_protocol:String-instance-method","name":"network_protocol","doc":"\nReturn the network protocol for this process\n","summary":"

Return the network protocol for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L152"},"def":{"name":"network_protocol","return_type":"String","visibility":"Public","body":"@options.network_protocol || \"tcp\""}},{"html_id":"options:Procodile::ProcessOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::ProcessOption)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(options : Procodile::ProcessOption)","args_html":"(options : Procodile::ProcessOption)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"@options = options"}},{"html_id":"proxy?:Bool-instance-method","name":"proxy?","doc":"\nIs this process enabled for proxying?\n","summary":"

Is this process enabled for proxying?

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L131"},"def":{"name":"proxy?","return_type":"Bool","visibility":"Public","body":"!(!@options.proxy_port)"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L145"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_address || \"127.0.0.1\" : nil"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L138"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_port : nil"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","doc":"\nHow many instances of this process should be started\n","summary":"

How many instances of this process should be started

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L55"},"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@options.quantity || 1"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"removed","visibility":"Public","body":"@removed"}},{"html_id":"removed=(removed:Bool)-instance-method","name":"removed=","abstract":false,"args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"args_string":"(removed : Bool)","args_html":"(removed : Bool)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"removed=","args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"visibility":"Public","body":"@removed = removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","doc":"\nThe respawn window. One hour by default.\n","summary":"

The respawn window.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":69,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L69"},"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@options.respawn_window || 3600"}},{"html_id":"restart_mode:String|Signal-instance-method","name":"restart_mode","doc":"\nDefines how this process should be restarted\n\nstart-term = start new instances and send term to children\nusr1 = just send a usr1 signal to the current instance\nusr2 = just send a usr2 signal to the current instance\nterm-start = stop the old instances, when no longer running, start a new one\n","summary":"

Defines how this process should be restarted

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":117,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L117"},"def":{"name":"restart_mode","return_type":"String | Signal","visibility":"Public","body":"@options.restart_mode || \"term-start\""}},{"html_id":"term_signal:Signal-instance-method","name":"term_signal","doc":"\nReturn the signal to send to terminate the process\n","summary":"

Return the signal to send to terminate the process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L105"},"def":{"name":"term_signal","return_type":"Signal","visibility":"Public","body":"@options.term_signal || Signal::TERM"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn a hash\n","summary":"

Return a hash

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":179,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L179"},"def":{"name":"to_hash","visibility":"Public","body":"ControlClientProcessStatus.new(name: self.name, log_color: self.log_color, quantity: self.quantity, max_respawns: self.max_respawns, respawn_window: self.respawn_window, command: self.command, restart_mode: self.restart_mode, log_path: self.log_path, removed: self.removed ? true : false, proxy_port: proxy_port, proxy_address: proxy_address)"}}]},{"html_id":"procodile/Procodile/ProcessOption","path":"Procodile/ProcessOption.html","kind":"struct","full_name":"Procodile::ProcessOption","name":"ProcessOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L7"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L22"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@allocate_port_from"}},{"html_id":"allocate_port_from=(allocate_port_from:Int32|Nil)-instance-method","name":"allocate_port_from=","abstract":false,"args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"args_string":"(allocate_port_from : Int32 | Nil)","args_html":"(allocate_port_from : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from=","args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@allocate_port_from = allocate_port_from"}},{"html_id":"env:Hash(String,String)-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L20"},"def":{"name":"env","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String))-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"args_string":"(env : Hash(String, String))","args_html":"(env : Hash(String, String))","location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L20"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"visibility":"Public","body":"@env = env"}},{"html_id":"log_file_name:String|Nil-instance-method","name":"log_file_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name","return_type":"String | ::Nil","visibility":"Public","body":"@log_file_name"}},{"html_id":"log_file_name=(log_file_name:String|Nil)-instance-method","name":"log_file_name=","abstract":false,"args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"args_string":"(log_file_name : String | Nil)","args_html":"(log_file_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name=","args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_file_name = log_file_name"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"max_respawns:Int32|Nil-instance-method","name":"max_respawns","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns","return_type":"Int32 | ::Nil","visibility":"Public","body":"@max_respawns"}},{"html_id":"max_respawns=(max_respawns:Int32|Nil)-instance-method","name":"max_respawns=","abstract":false,"args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"args_string":"(max_respawns : Int32 | Nil)","args_html":"(max_respawns : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns=","args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@max_respawns = max_respawns"}},{"html_id":"merge(other:self|Nil)-instance-method","name":"merge","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"args_string":"(other : self | Nil)","args_html":"(other : self | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L25"},"def":{"name":"merge","args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"visibility":"Public","body":"new_process_option = self\nif other.quantity\n new_process_option.quantity = other.quantity\nend\nif other.restart_mode\n new_process_option.restart_mode = other.restart_mode\nend\nif other.max_respawns\n new_process_option.max_respawns = other.max_respawns\nend\nif other.respawn_window\n new_process_option.respawn_window = other.respawn_window\nend\nif other.log_path\n new_process_option.log_path = other.log_path\nend\nif other.log_file_name\n new_process_option.log_file_name = other.log_file_name\nend\nif other.term_signal\n new_process_option.term_signal = other.term_signal\nend\nif other.allocate_port_from\n new_process_option.allocate_port_from = other.allocate_port_from\nend\nif other.proxy_port\n new_process_option.proxy_port = other.proxy_port\nend\nif other.proxy_address\n new_process_option.proxy_address = other.proxy_address\nend\nif other.network_protocol\n new_process_option.network_protocol = other.network_protocol\nend\nif other.env\n new_process_option.env = new_process_option.env.merge(other.env)\nend\nnew_process_option\n"}},{"html_id":"network_protocol:String|Nil-instance-method","name":"network_protocol","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol","return_type":"String | ::Nil","visibility":"Public","body":"@network_protocol"}},{"html_id":"network_protocol=(network_protocol:String|Nil)-instance-method","name":"network_protocol=","abstract":false,"args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"args_string":"(network_protocol : String | Nil)","args_html":"(network_protocol : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol=","args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"visibility":"Public","body":"@network_protocol = network_protocol"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_address=(proxy_address:String|Nil)-instance-method","name":"proxy_address=","abstract":false,"args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(proxy_address : String | Nil)","args_html":"(proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address=","args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"@proxy_address = proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"proxy_port=(proxy_port:Int32|Nil)-instance-method","name":"proxy_port=","abstract":false,"args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"args_string":"(proxy_port : Int32 | Nil)","args_html":"(proxy_port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port=","args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@proxy_port = proxy_port"}},{"html_id":"quantity:Int32|Nil-instance-method","name":"quantity","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity","return_type":"Int32 | ::Nil","visibility":"Public","body":"@quantity"}},{"html_id":"quantity=(quantity:Int32|Nil)-instance-method","name":"quantity=","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"args_string":"(quantity : Int32 | Nil)","args_html":"(quantity : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity=","args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@quantity = quantity"}},{"html_id":"respawn_window:Int32|Nil-instance-method","name":"respawn_window","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window","return_type":"Int32 | ::Nil","visibility":"Public","body":"@respawn_window"}},{"html_id":"respawn_window=(respawn_window:Int32|Nil)-instance-method","name":"respawn_window=","abstract":false,"args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"args_string":"(respawn_window : Int32 | Nil)","args_html":"(respawn_window : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window=","args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@respawn_window = respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}},{"html_id":"restart_mode=(restart_mode:Signal|String|Nil)-instance-method","name":"restart_mode=","abstract":false,"args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"args_string":"(restart_mode : Signal | String | Nil)","args_html":"(restart_mode : Signal | String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode=","args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"visibility":"Public","body":"@restart_mode = restart_mode"}},{"html_id":"term_signal:Signal|Nil-instance-method","name":"term_signal","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal","return_type":"Signal | ::Nil","visibility":"Public","body":"@term_signal"}},{"html_id":"term_signal=(term_signal:Signal|Nil)-instance-method","name":"term_signal=","abstract":false,"args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"args_string":"(term_signal : Signal | Nil)","args_html":"(term_signal : Signal | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal=","args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"visibility":"Public","body":"@term_signal = term_signal"}}]},{"html_id":"procodile/Procodile/ProcfileOption","path":"Procodile/ProcfileOption.html","kind":"struct","full_name":"Procodile::ProcfileOption","name":"ProcfileOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L45"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":46,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L46"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":60,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L60"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String|Nil-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name","return_type":"String | ::Nil","visibility":"Public","body":"@app_name"}},{"html_id":"app_name=(app_name:String|Nil)-instance-method","name":"app_name=","abstract":false,"args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"args_string":"(app_name : String | Nil)","args_html":"(app_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name=","args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@app_name = app_name"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"@console_command"}},{"html_id":"console_command=(console_command:String|Nil)-instance-method","name":"console_command=","abstract":false,"args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"args_string":"(console_command : String | Nil)","args_html":"(console_command : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command=","args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"visibility":"Public","body":"@console_command = console_command"}},{"html_id":"env:Hash(String,String)|Nil-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L57"},"def":{"name":"env","return_type":"Hash(String, String) | ::Nil","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String)|Nil)-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"args_string":"(env : Hash(String, String) | Nil)","args_html":"(env : Hash(String, String) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L57"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"visibility":"Public","body":"@env = env"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"@exec_prefix"}},{"html_id":"exec_prefix=(exec_prefix:String|Nil)-instance-method","name":"exec_prefix=","abstract":false,"args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"args_string":"(exec_prefix : String | Nil)","args_html":"(exec_prefix : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix=","args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"visibility":"Public","body":"@exec_prefix = exec_prefix"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"log_root=(log_root:String|Nil)-instance-method","name":"log_root=","abstract":false,"args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(log_root : String | Nil)","args_html":"(log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root=","args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_root = log_root"}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"@pid_root"}},{"html_id":"pid_root=(pid_root:String|Nil)-instance-method","name":"pid_root=","abstract":false,"args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"args_string":"(pid_root : String | Nil)","args_html":"(pid_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root=","args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@pid_root = pid_root"}},{"html_id":"processes:Hash(String,ProcessOption)|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes","return_type":"Hash(String, ProcessOption) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:Hash(String,ProcessOption)|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"args_string":"(processes : Hash(String, ProcessOption) | Nil)","args_html":"(processes : Hash(String, ProcessOption) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"procfile:String|Nil-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile","return_type":"String | ::Nil","visibility":"Public","body":"@procfile"}},{"html_id":"procfile=(procfile:String|Nil)-instance-method","name":"procfile=","abstract":false,"args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(procfile : String | Nil)","args_html":"(procfile : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile=","args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"@procfile = procfile"}},{"html_id":"root:String|Nil-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L49"},"def":{"name":"root","return_type":"String | ::Nil","visibility":"Public","body":"@root"}},{"html_id":"root=(root:String|Nil)-instance-method","name":"root=","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"args_string":"(root : String | Nil)","args_html":"(root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L49"},"def":{"name":"root=","args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@root = root"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L54"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"@user"}},{"html_id":"user=(user:String|Nil)-instance-method","name":"user=","abstract":false,"args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"args_string":"(user : String | Nil)","args_html":"(user : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L54"},"def":{"name":"user=","args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"visibility":"Public","body":"@user = user"}}]},{"html_id":"procodile/Procodile/RunOptions","path":"Procodile/RunOptions.html","kind":"struct","full_name":"Procodile::RunOptions","name":"RunOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"force_single_log:Bool|Nil-instance-method","name":"force_single_log","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log","return_type":"Bool | ::Nil","visibility":"Public","body":"@force_single_log"}},{"html_id":"force_single_log=(force_single_log:Bool|Nil)-instance-method","name":"force_single_log=","abstract":false,"args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"args_string":"(force_single_log : Bool | Nil)","args_html":"(force_single_log : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log=","args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@force_single_log = force_single_log"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}}]},{"html_id":"procodile/Procodile/SignalHandler","path":"Procodile/SignalHandler.html","kind":"class","full_name":"Procodile::SignalHandler","name":"SignalHandler","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/signal_handler.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"QUEUE","name":"QUEUE","value":"[] of Signal"},{"id":"SIGNALS","name":"SIGNALS","value":"{Signal::TERM, Signal::USR1, Signal::USR2, Signal::INT, Signal::HUP}"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L14"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"handle-instance-method","name":"handle","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L45"},"def":{"name":"handle","visibility":"Public","body":"if (signal = QUEUE.shift?)\n Procodile.log(nil, \"system\", \"Supervisor received #{signal} signal\")\n @handlers[signal].try(&.each(&.call))\nend"}},{"html_id":"notice-instance-method","name":"notice","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":41,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L41"},"def":{"name":"notice","visibility":"Public","body":"@pipe[:writer].write(\".\".to_slice)"}},{"html_id":"pipe:Hash(Symbol,IO::FileDescriptor)-instance-method","name":"pipe","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L12"},"def":{"name":"pipe","return_type":"Hash(Symbol, IO::FileDescriptor)","visibility":"Public","body":"@pipe"}},{"html_id":"register(signal:Signal,&block)-instance-method","name":"register","abstract":false,"args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"args_string":"(signal : Signal, &block)","args_html":"(signal : Signal, &block)","location":{"filename":"src/procodile/signal_handler.cr","line_number":36,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L36"},"def":{"name":"register","args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"__temp_54 = signal\n@handlers[__temp_54]? || (@handlers[__temp_54] = [] of Proc(Nil))\n@handlers[signal] << block\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L27"},"def":{"name":"start","visibility":"Public","body":"spawn do\n loop do\n handle\n sleep(1)\n end\nend"}}]},{"html_id":"procodile/Procodile/StatusCLIOutput","path":"Procodile/StatusCLIOutput.html","kind":"class","full_name":"Procodile::StatusCLIOutput","name":"StatusCLIOutput","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/status_cli_output.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(status:Procodile::ControlClientReplyForStatusCommand)-class-method","name":"new","abstract":false,"args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"args_string":"(status : Procodile::ControlClientReplyForStatusCommand)","args_html":"(status : Procodile::ControlClientReplyForStatusCommand)","location":{"filename":"src/procodile/status_cli_output.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L5"},"def":{"name":"new","args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"visibility":"Public","body":"_ = allocate\n_.initialize(status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"print_all-instance-method","name":"print_all","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L8"},"def":{"name":"print_all","visibility":"Public","body":"print_header\nprint_processes\n"}},{"html_id":"print_header-instance-method","name":"print_header","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L13"},"def":{"name":"print_header","visibility":"Public","body":"puts(\"Procodile Version #{@status.version.to_s.color(34)}\")\nputs(\"Application Root #{(@status.root).to_s.color(34)}\")\nputs(\"Supervisor PID #{(@status.supervisor[\"pid\"]).to_s.color(34)}\")\nif (time = @status.supervisor[\"started_at\"])\n time = Time.unix(time)\n puts(\"Started #{time.to_s.color(34)}\")\nend\nif !@status.environment_variables.empty?\n @status.environment_variables.each_with_index do |__arg0, index|\n key = __arg0[0]\n value = __arg0[1]\n if index == 0\n print(\"Environment Vars \")\n else\n print(\" \")\n end\n print(key.color(34))\n puts(\" #{value}\")\n end\nend\nif @status.messages.empty?\nelse\n puts\n @status.messages.each do |message|\n puts(\"\\e[31m * #{Message.parse(message)}\\e[0m\")\n end\nend\n"}},{"html_id":"print_processes-instance-method","name":"print_processes","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":40,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L40"},"def":{"name":"print_processes","visibility":"Public","body":"puts\n@status.processes.each_with_index do |process, index|\n if index == 0\n else\n puts\n end\n puts((\"|| \".color(process.log_color)) + (process.name.color(process.log_color)))\n puts(\"#{\"||\".color(process.log_color)} Quantity #{process.quantity}\")\n puts(\"#{\"||\".color(process.log_color)} Command #{process.command}\")\n puts(\"#{\"||\".color(process.log_color)} Respawning #{process.max_respawns} every #{process.respawn_window} seconds\")\n puts(\"#{\"||\".color(process.log_color)} Restart mode #{process.restart_mode}\")\n puts(\"#{\"||\".color(process.log_color)} Log path #{process.log_path || \"none specified\"}\")\n puts(\"#{\"||\".color(process.log_color)} Address/Port #{process.proxy_port ? \"#{process.proxy_address}:#{process.proxy_port}\" : \"none\"}\")\n instances = @status.instances[process.name]\n if instances.empty?\n puts(\"#{\"||\".color(process.log_color)} No processes running.\")\n else\n instances.each do |instance|\n print((\"|| => \".color(process.log_color)) + ((instance.description.to_s.ljust(17, ' ')).color(process.log_color)))\n print(instance.status.ljust(10, ' '))\n print(\" #{(formatted_timestamp(instance.started_at)).ljust(10, ' ')}\")\n print(\" pid:#{instance.pid.to_s.ljust(6, ' ')}\")\n print(\" respawns:#{instance.respawns.to_s.ljust(4, ' ')}\")\n print(\" port:#{(instance.port || '-').to_s.ljust(6, ' ')}\")\n print(\" tag:#{instance.tag || '-'}\")\n puts\n end\n end\nend\n"}}]},{"html_id":"procodile/Procodile/Supervisor","path":"Procodile/Supervisor.html","kind":"class","full_name":"Procodile::Supervisor","name":"Supervisor","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/supervisor.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L9"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,run_options:Procodile::RunOptions=Procodile::RunOptions.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"args_string":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","args_html":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L15"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, run_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_instance(instance,io=nil)-instance-method","name":"add_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"args_string":"(instance, io = nil)","args_html":"(instance, io = nil)","location":{"filename":"src/procodile/supervisor.cr","line_number":234,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L234"},"def":{"name":"add_instance","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"visibility":"Public","body":"if io\n add_reader(instance, io)\nend\n__temp_44 = instance.process\n@processes[__temp_44]? || (@processes[__temp_44] = [] of Procodile::Instance)\nif @processes[instance.process].includes?(instance)\nelse\n @processes[instance.process] << instance\nend\n"}},{"html_id":"add_reader(instance,io)-instance-method","name":"add_reader","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"args_string":"(instance, io)","args_html":"(instance, io)","location":{"filename":"src/procodile/supervisor.cr","line_number":229,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L229"},"def":{"name":"add_reader","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"visibility":"Public","body":"@readers[io] = instance\n@signal_handler.notice\n"}},{"html_id":"allow_respawning?:Bool-instance-method","name":"allow_respawning?","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L27"},"def":{"name":"allow_respawning?","return_type":"Bool","visibility":"Public","body":"@run_options.respawn != false"}},{"html_id":"check_concurrency(options={}ofString=>String):Hash(Symbol,Array(Procodile::Instance))-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","args_html":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","location":{"filename":"src/procodile/supervisor.cr","line_number":175,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L175"},"def":{"name":"check_concurrency","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"return_type":"Hash(Symbol, Array(Procodile::Instance))","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Checking process concurrency\")\nif options.reload == false\nelse\n reload_config\nend\nresult = check_instance_quantities\nif result[:started].empty? && result[:stopped].empty?\n Procodile.log(nil, \"system\", \"Process concurrency looks good\")\nelse\n if result[:started].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check started #{result[:started].map(&.description).join(\", \")}\")\n end\n if result[:stopped].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check stopped #{result[:stopped].map(&.description).join(\", \")}\")\n end\nend\nresult\n"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":203,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L203"},"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"messages = [] of SupervisorMessages\nprocesses.each do |process, process_instances|\n if process.correct_quantity?(process_instances.size)\n else\n messages << SupervisorMessages.new(type: \"incorrect_quantity\", process: process.name, current: process_instances.size, desired: process.quantity)\n end\n process_instances.each do |instance|\n if instance.should_be_running? && (instance.status != \"Running\")\n messages << SupervisorMessages.new(type: \"not_running\", instance: instance.description, status: instance.status)\n end\n end\nend\nmessages\n"}},{"html_id":"processes:Hash(Procodile::Process,Array(Procodile::Instance))-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"processes","visibility":"Public","body":"@processes"}},{"html_id":"reload_config-instance-method","name":"reload_config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L170"},"def":{"name":"reload_config","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Reloading configuration\")\n@config.reload\n"}},{"html_id":"remove_instance(instance)-instance-method","name":"remove_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""}],"args_string":"(instance)","args_html":"(instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":242,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L242"},"def":{"name":"remove_instance","args":[{"name":"instance","external_name":"instance","restriction":""}],"visibility":"Public","body":"if @processes[instance.process]\n @processes[instance.process].delete(instance)\n @readers.delete(instance)\nend"}},{"html_id":"restart(options=SupervisorOptions.new)-instance-method","name":"restart","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new)","args_html":"(options = SupervisorOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L110"},"def":{"name":"restart","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_restarted = [] of Array(Procodile::Instance | ::Nil)\nprocesses = options.processes\nif processes.nil?\n Procodile.log(nil, \"system\", \"Restarting all #{@config.app_name} processes\")\n instances = @processes.values.flatten\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Restarting #{instances.size} process(es)\")\nend\nstopped = (check_instance_quantities(:stopped, processes))[:stopped].map do |i|\n [i, nil]\nend\ninstances_restarted.concat(stopped)\ninstances.each do |instance|\n if instance.stopping?\n next\n end\n new_instance = instance.restart\n instances_restarted << [instance, new_instance]\nend\nchecked = (check_instance_quantities(:started, processes))[:started].map do |i|\n [nil, i]\nend\ninstances_restarted.concat(checked)\ninstances_restarted\n"}},{"html_id":"run_options:Procodile::RunOptions-instance-method","name":"run_options","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"run_options","visibility":"Public","body":"@run_options"}},{"html_id":"start(after_start:Proc(Procodile::Supervisor,Nil))-instance-method","name":"start","abstract":false,"args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"args_string":"(after_start : Proc(Procodile::Supervisor, Nil))","args_html":"(after_start : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/supervisor.cr","line_number":31,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L31"},"def":{"name":"start","args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"visibility":"Public","body":"begin\n Procodile.log(nil, \"system\", \"Procodile supervisor started with PID #{::Process.pid}\")\n Procodile.log(nil, \"system\", \"Application root is #{@config.root}\")\n if @run_options.respawn == false\n Procodile.log(nil, \"system\", \"Automatic respawning is disabled\")\n end\n ControlServer.start(self)\n if @run_options.proxy\n Procodile.log(nil, \"system\", \"Proxy is enabled\")\n @tcp_proxy = TCPProxy.start(self)\n end\n watch_for_output\n @started_at = Time.local\n after_start.call(self)\nrescue e\n Procodile.log(nil, \"system\", \"Error: #{e.class} (#{e.message})\")\n e.backtrace.each do |bt|\n Procodile.log(nil, \"system\", \"=> #{bt})\")\n end\n stop(SupervisorOptions.new(stop_supervisor: true))\nensure\n loop do\n supervise\n sleep(3)\n end\nend"}},{"html_id":"start_processes(process_names:Array(String)|Nil,options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"start_processes","abstract":false,"args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":61,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L61"},"def":{"name":"start_processes","args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_started = [] of Procodile::Instance\n@config.processes.each do |name, process|\n if process_names && (!(process_names.includes?(name.to_s)))\n next\n end\n if @processes[process]? && (!@processes[process].empty?)\n next\n end\n instances = process.generate_instances(self)\n instances.each(&.start)\n instances_started.concat(instances)\nend\ninstances_started\n"}},{"html_id":"started_at:Time?-instance-method","name":"started_at","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"started_at","visibility":"Public","body":"@started_at"}},{"html_id":"stop(options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"stop","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L80"},"def":{"name":"stop","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"if options.stop_supervisor\n @run_options.stop_when_none = true\nend\nreload_config\nprocesses = options.processes\ninstances_stopped = [] of Procodile::Instance\nif processes.nil?\n Procodile.log(nil, \"system\", \"Stopping all #{@config.app_name} processes\")\n @processes.each do |_, instances|\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\n end\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Stopping #{instances.size} process(es)\")\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\nend\ninstances_stopped\n"}},{"html_id":"stop_supervisor-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L145"},"def":{"name":"stop_supervisor","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Stopping Procodile supervisor\")\nFileUtils.rm_rf(File.join(@config.pid_root, \"procodile.pid\"))\n::Process.exit(0)\n"}},{"html_id":"supervise-instance-method","name":"supervise","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":151,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L151"},"def":{"name":"supervise","visibility":"Public","body":"remove_stopped_instances\nremove_removed_processes\n@processes.each do |_, instances|\n instances.each(&.check)\nend\nif @run_options.stop_when_none && @processes.all? do |_, instances|\n instances.reject(&.failed?).empty?\nend\n Procodile.log(nil, \"system\", \"All processes have stopped\")\n stop_supervisor\nend\n"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tcp_proxy:Procodile::TCPProxy?-instance-method","name":"tcp_proxy","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"tcp_proxy","visibility":"Public","body":"@tcp_proxy"}},{"html_id":"to_hash-instance-method","name":"to_hash","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":196,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L196"},"def":{"name":"to_hash","visibility":"Public","body":"{started_at: @started_at.not_nil!.to_unix, pid: ::Process.pid}"}}]},{"html_id":"procodile/Procodile/SupervisorMessages","path":"Procodile/SupervisorMessages.html","kind":"struct","full_name":"Procodile::SupervisorMessages","name":"SupervisorMessages","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(type:String,process:String|Nil=nil,current:Int32|Nil=nil,desired:Int32|Nil=nil,instance:String|Nil=nil,status:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"args_string":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","args_html":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"new","args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(type, process, current, desired, instance, status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":147,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L147"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@type.clone, @process.clone, @current.clone, @desired.clone, @instance.clone, @status.clone)"}},{"html_id":"copy_with(type_type=@type,process_process=@process,current_current=@current,desired_desired=@desired,instance_instance=@instance,status_status=@status)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"args_string":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","args_html":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"copy_with","args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"visibility":"Public","body":"self.class.new(_type, _process, _current, _desired, _instance, _status)"}},{"html_id":"current:Int32|Nil-instance-method","name":"current","abstract":false,"def":{"name":"current","return_type":"Int32 | ::Nil","visibility":"Public","body":"@current"}},{"html_id":"desired:Int32|Nil-instance-method","name":"desired","abstract":false,"def":{"name":"desired","return_type":"Int32 | ::Nil","visibility":"Public","body":"@desired"}},{"html_id":"instance:String|Nil-instance-method","name":"instance","abstract":false,"def":{"name":"instance","return_type":"String | ::Nil","visibility":"Public","body":"@instance"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"status:String|Nil-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String | ::Nil","visibility":"Public","body":"@status"}},{"html_id":"type:String-instance-method","name":"type","abstract":false,"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"procodile/Procodile/SupervisorOptions","path":"Procodile/SupervisorOptions.html","kind":"struct","full_name":"Procodile::SupervisorOptions","name":"SupervisorOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=nil,stop_supervisor:Bool|Nil=nil,tag:String|Nil=nil,reload:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"new","args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, stop_supervisor, tag, reload)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @stop_supervisor.clone, @tag.clone, @reload.clone)"}},{"html_id":"copy_with(processes_processes=@processes,stop_supervisor_stop_supervisor=@stop_supervisor,tag_tag=@tag,reload_reload=@reload)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"args_string":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","args_html":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _stop_supervisor, _tag, _reload)"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/TCPProxy","path":"Procodile/TCPProxy.html","kind":"class","full_name":"Procodile::TCPProxy","name":"TCPProxy","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/tcp_proxy.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L3"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"proxy = new(supervisor)\nproxy.start\nproxy\n"}}],"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"args_string":"(supervisor : Procodile::Supervisor)","args_html":"(supervisor : Procodile::Supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L9"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_process(process)-instance-method","name":"add_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L23"},"def":{"name":"add_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"begin\n if process.proxy?\n @listeners[TCPServer.new(process.proxy_address.not_nil!, process.proxy_port.not_nil!)] = process\n Procodile.log(nil, \"proxy\", \"Proxying traffic on #{process.proxy_address}:#{process.proxy_port} to #{process.name}\".color(32))\n @sp_writer.write(\".\".to_slice)\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nend"}},{"html_id":"handle_client(client,server)-instance-method","name":"handle_client","abstract":false,"args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"args_string":"(client, server)","args_html":"(client, server)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L86"},"def":{"name":"handle_client","args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"visibility":"Public","body":"begin\n process = @listeners[server]\n instances = @supervisor.processes[process]? || ([] of Procodile::Instance)\n if instances.empty?\n Procodile.log(nil, \"proxy\", \"There are no processes running for #{process.name}\")\n else\n instance = instances[rand(instances.size)]\n backend_socket = begin\n TCPSocket.new(\"127.0.0.1\", instance.port)\n rescue\n nil\n end\n if backend_socket.nil?\n Procodile.log(nil, \"proxy\", \"Could not connect to #{instance.description}:#{instance.port}\")\n return\n end\n readers = {:backend => backend_socket, :client => client}\n sleep_chan = Channel(Nil).new\n readers_chan = Channel(Nil).new\n spawn do\n loop do\n sleep(0.5)\n sleep_chan.send(nil)\n end\n end\n readers.values.each do |socket|\n spawn do\n loop do\n key = readers.key_for(socket)\n opposite_side = key == (:client) ? :backend : :client\n if socket.read_byte\n readers.delete(opposite_side)\n else\n begin\n readers[opposite_side].write(Bytes.new(socket.read(Bytes.new(1024))))\n rescue\n nil\n end\n end\n readers_chan.send(nil)\n end\n end\n end\n loop do\n select\nwhen readers_chan.receive\nwhen sleep_chan.receive\nend\n\n end\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nensure\n if backend_socket\n backend_socket.close\n end\n if client\n client.close\n end\nend"}},{"html_id":"listen-instance-method","name":"listen","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":39,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L39"},"def":{"name":"listen","visibility":"Public","body":"sleep_chan = Channel(Nil).new\nsp_reader_chan = Channel(Nil).new\nlistener_chan = Channel(Nil).new\nspawn do\n loop do\n sleep(30)\n sleep_chan.send(nil)\n end\nend\nspawn do\n loop do\n @sp_reader.read(Bytes.new(999))\n sp_reader_chan.send(nil)\n end\nend\n@listeners.keys.each do |io|\n spawn do\n loop do\n handle_client(client: io.accept, server: io)\n listener_chan.send(nil)\n end\n end\nend\nloop do\n select\nwhen sp_reader_chan.receive\nwhen listener_chan.receive\nwhen sleep_chan.receive\nend\n\n @stopped_processes.reject do |process|\n if ( io = @listeners.key_for(process))\n Procodile.log(nil, \"proxy\", \"Stopped proxy listener for #{process.name}\")\n io.close\n @listeners.delete(io)\n end\n true\n end\nend\n"}},{"html_id":"remove_process(process)-instance-method","name":"remove_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L34"},"def":{"name":"remove_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"@stopped_processes << process\n@sp_writer.write(\".\".to_slice)\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L15"},"def":{"name":"start","visibility":"Public","body":"@supervisor.config.processes.each do |_, p|\n add_process(p)\nend\nspawn do\n listen\n Procodile.log(nil, \"proxy\", \"Stopped listening on all ports\")\nend\n"}}]}]},{"html_id":"procodile/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/color.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/color.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nString might end up being conformed of bytes which are an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but\ninvalid byte sequences, when asked as chars, will use the unicode replacement\nchar (value 0xFFFD). For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","instance_methods":[{"html_id":"color(color)-instance-method","name":"color","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""}],"args_string":"(color)","args_html":"(color)","location":{"filename":"src/procodile/color.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/color.cr#L2"},"def":{"name":"color","args":[{"name":"color","external_name":"color","restriction":""}],"visibility":"Public","body":"\"\\e[#{color}m#{self}\\e[0m\""}}]}]}} \ No newline at end of file +{"repository_name":"procodile","body":"# Procodile 🐊\n\nRunning & deploying Ruby apps to places like [Viaduct](https://viaduct.io) & Heroku is really easy but running processes on actual servers is less fun. Procodile aims to take some the stress out of running your Ruby/Rails apps and give you some of the useful process management features you get from the takes of the PaaS providers.\n\nProcodile is a bit like [Foreman](https://github.com/ddollar/foreman) but things are designed to run in the background (as well as the foreground if you prefer) and there's a supervisor which keeps an eye on your processes and will respawn them if they die.\n\nProcodile works out of the box with your existing `Procfile`.\n\n* [Watch a quick screencast](https://vimeo.com/188041935)\n* [Read documentation](https://github.com/adamcooke/procodile/wiki)\n* [View on RubyGems](https://rubygems.org/gems/procodile)\n* [Check the CHANGELOG](https://github.com/adamcooke/procodile/blob/master/CHANGELOG.md)\n\n![Screenshot](https://share.adam.ac/16/cAZRKUM7.png)\n","program":{"html_id":"procodile/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"procodile","program":true,"enum":false,"alias":false,"const":false,"constants":[{"id":"ORIGINAL_ARGV","name":"ORIGINAL_ARGV","value":"ARGV.join(\" \")"}],"types":[{"html_id":"procodile/Procodile","path":"Procodile.html","kind":"module","full_name":"Procodile","name":"Procodile","abstract":false,"locations":[{"filename":"src/procodile.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L6"},{"filename":"src/procodile/app_determination.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L3"},{"filename":"src/procodile/cli.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L6"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L1"},{"filename":"src/procodile/commands/console_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L1"},{"filename":"src/procodile/commands/exec_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L1"},{"filename":"src/procodile/commands/help_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L1"},{"filename":"src/procodile/commands/kill_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L1"},{"filename":"src/procodile/commands/log_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L1"},{"filename":"src/procodile/commands/reload_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L1"},{"filename":"src/procodile/commands/restart_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L1"},{"filename":"src/procodile/commands/run_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L1"},{"filename":"src/procodile/commands/start_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L1"},{"filename":"src/procodile/commands/status_command.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L4"},{"filename":"src/procodile/commands/stop_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L1"},{"filename":"src/procodile/config.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L3"},{"filename":"src/procodile/control_client.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L4"},{"filename":"src/procodile/control_server.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L4"},{"filename":"src/procodile/control_session.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L4"},{"filename":"src/procodile/error.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/error.cr#L1"},{"filename":"src/procodile/instance.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L3"},{"filename":"src/procodile/logger.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L3"},{"filename":"src/procodile/message.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L1"},{"filename":"src/procodile/process.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L3"},{"filename":"src/procodile/procfile_option.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L5"},{"filename":"src/procodile/signal_handler.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L1"},{"filename":"src/procodile/status_cli_output.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L3"},{"filename":"src/procodile/supervisor.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L8"},{"filename":"src/procodile/tcp_proxy.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L1"},{"filename":"src/procodile/version.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/version.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/procodile_cr/procodile_cr/src/procodile\\\"`).chomp.stringify }}"}],"class_methods":[{"html_id":"bin_path-class-method","name":"bin_path","abstract":false,"location":{"filename":"src/procodile.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L11"},"def":{"name":"bin_path","visibility":"Public","body":"File.join(root, \"bin\", \"procodile\")"}},{"html_id":"log(color,name,text)-class-method","name":"log","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"args_string":"(color, name, text)","args_html":"(color, name, text)","location":{"filename":"src/procodile/logger.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L8"},"def":{"name":"log","args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"visibility":"Public","body":"mutex.synchronize do\n text.to_s.lines.map(&.chomp).each do |message|\n output = \"\"\n output = output + (\"#{Time.local.to_s(\"%H:%M:%S\")} #{name.ljust(18, ' ')} | \".color(color))\n output = output + message\n STDOUT.puts(output)\n STDOUT.flush\n end\nend"}},{"html_id":"mutex:Mutex-class-method","name":"mutex","abstract":false,"location":{"filename":"src/procodile/logger.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L4"},"def":{"name":"mutex","return_type":"Mutex","visibility":"Public","body":"@@mutex || (@@mutex = Mutex.new)"}},{"html_id":"root-class-method","name":"root","abstract":false,"location":{"filename":"src/procodile.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L7"},"def":{"name":"root","visibility":"Public","body":"File.expand_path(\"..\", \"/home/runner/work/procodile_cr/procodile_cr/src\")"}}],"types":[{"html_id":"procodile/Procodile/AppDetermination","path":"Procodile/AppDetermination.html","kind":"class","full_name":"Procodile::AppDetermination","name":"AppDetermination","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/app_determination.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L7"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"doc":"\nThis class is responsible for determining which application should be used\n","summary":"

This class is responsible for determining which application should be used

","constructors":[{"html_id":"new(pwd:String,given_root:String|Nil,given_procfile:String|Nil,global_options=nil)-class-method","name":"new","doc":"Start by creating an determination ased on the root and procfile that has been provided\nto us by the user (from --root and/or --procfile)","summary":"

Start by creating an determination ased on the root and procfile that has been provided to us by the user (from --root and/or --procfile)

","abstract":false,"args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"args_string":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","args_html":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","location":{"filename":"src/procodile/app_determination.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L19"},"def":{"name":"new","args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(pwd, given_root, given_procfile, global_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"procfile:String?-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L15"},"def":{"name":"procfile","visibility":"Public","body":"@procfile"}},{"html_id":"root:String?-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L15"},"def":{"name":"root","visibility":"Public","body":"@root"}}]},{"html_id":"procodile/Procodile/CLI","path":"Procodile/CLI.html","kind":"class","full_name":"Procodile::CLI","name":"CLI","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/cli.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L7"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L2"},{"filename":"src/procodile/commands/console_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L2"},{"filename":"src/procodile/commands/exec_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L2"},{"filename":"src/procodile/commands/help_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L2"},{"filename":"src/procodile/commands/kill_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L2"},{"filename":"src/procodile/commands/log_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L2"},{"filename":"src/procodile/commands/reload_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L2"},{"filename":"src/procodile/commands/restart_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L2"},{"filename":"src/procodile/commands/run_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L2"},{"filename":"src/procodile/commands/start_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L2"},{"filename":"src/procodile/commands/status_command.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L5"},{"filename":"src/procodile/commands/stop_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COMMANDS","name":"COMMANDS","value":"[{:help, \"Shows this help output\"}, {:kill, \"Forcefully kill all known processes\"}, {:start, \"Starts processes and/or the supervisor\"}, {:stop, \"Stops processes and/or the supervisor\"}, {:exec, \"Execute a command within the environment\"}, {:run, \"Execute a command within the environment\"}, {:reload, \"Reload Procodile configuration\"}, {:check_concurrency, \"Check process concurrency\"}, {:log, \"Open/stream a Procodile log file\"}, {:restart, \"Restart processes\"}, {:status, \"Show the current status of processes\"}, {:console, \"Open a console within the environment\"}]"}],"included_modules":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"commands:Hash(String,CliCommand)-class-method","name":"commands","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L24"},"def":{"name":"commands","return_type":"Hash(String, CliCommand)","visibility":"Public","body":"@@commands || (@@commands = {} of String => CliCommand)"}},{"html_id":"options(name,&block:Proc(OptionParser,Procodile::CLI,Nil))-class-method","name":"options","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","args_html":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":30,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L30"},"def":{"name":"options","args":[{"name":"name","external_name":"name","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(OptionParser, Procodile::CLI, Nil)"},"visibility":"Public","body":"@@options[name] = block"}},{"html_id":"start_supervisor(config:Procodile::Config,options=Procodile::CliOptions.new,&block:Proc(Procodile::Supervisor,Nil))-class-method","name":"start_supervisor","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"args_string":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","args_html":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L66"},"def":{"name":"start_supervisor","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(Procodile::Supervisor, Nil)"},"visibility":"Public","body":"run_options = Procodile::RunOptions.new\nrun_options.respawn = options.respawn\nrun_options.stop_when_none = options.stop_when_none\nrun_options.proxy = options.proxy\nrun_options.force_single_log = options.foreground\nrun_options.port_allocations = options.port_allocations\ntidy_pids(config)\nif options.clean\n FileUtils.rm_rf(Dir[File.join(config.pid_root, \"*\")])\n puts(\"Emptied PID directory\")\nend\nif !Dir[File.join(config.pid_root, \"*\")].empty?\n raise(Error.new(\"The PID directory (#{config.pid_root}) is not empty. Cannot start unless things are clean.\"))\nend\nFile.write(\"/proc/self/comm\", \"[procodile] #{config.app_name} (#{config.root})\")\nif options.foreground\n File.write(config.supervisor_pid_path, ::Process.pid)\n (Supervisor.new(config, run_options)).start(block)\nelse\n FileUtils.rm_rf(File.join(config.pid_root, \"*.pid\"))\n process = ::Process.fork do\n log_path = File.open(config.log_path, \"a\")\n STDOUT.reopen(log_path)\n STDOUT.sync = true\n STDERR.reopen(log_path)\n STDERR.sync = true\n (Supervisor.new(config, run_options)).start(block)\n end\n spawn do\n process.wait\n end\n pid = process.pid\n File.write(config.supervisor_pid_path, pid)\n puts(\"Started Procodile supervisor with PID #{pid}\")\nend\n"}},{"html_id":"tidy_pids(config:Procodile::Config)-class-method","name":"tidy_pids","doc":"Clean up procodile.pid and procodile.sock with all unused pid files","summary":"

Clean up procodile.pid and procodile.sock with all unused pid files

","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":116,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L116"},"def":{"name":"tidy_pids","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"visibility":"Public","body":"FileUtils.rm_rf(config.supervisor_pid_path)\nFileUtils.rm_rf(config.sock_path)\npid_files = Dir[File.join(config.pid_root, \"*.pid\")]\npid_files.each do |pid_path|\n file_name = (pid_path.split(\"/\")).last\n pid = (File.read(pid_path)).to_i\n if ::Process.exists?(pid)\n puts(\"Could not remove #{file_name} because process (#{pid}) was active\")\n else\n FileUtils.rm_rf(pid_path)\n puts(\"Removed #{file_name} because process was not active\")\n end\nend\n"}}],"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L34"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"config=(config:Procodile::Config)-instance-method","name":"config=","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"config=","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"visibility":"Public","body":"@config = config"}},{"html_id":"dispatch(command)-instance-method","name":"dispatch","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command)","args_html":"(command)","location":{"filename":"src/procodile/cli.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L58"},"def":{"name":"dispatch","args":[{"name":"command","external_name":"command","restriction":""}],"visibility":"Public","body":"if self.class.commands.has_key?(command)\n self.class.commands[command].callable.call\nelse\n raise(Error.new(\"Invalid command '#{command}'\"))\nend"}},{"html_id":"options:Procodile::CliOptions-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::CliOptions)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"args_string":"(options : Procodile::CliOptions)","args_html":"(options : Procodile::CliOptions)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"visibility":"Public","body":"@options = options"}}],"types":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","path":"Procodile/CLI/CheckConcurrencyCommand.html","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"check_concurrency-instance-method","name":"check_concurrency","abstract":false,"location":{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L12"},"def":{"name":"check_concurrency","visibility":"Public","body":"if supervisor_running?\n reply = (ControlClient.run(@config.sock_path, \"check_concurrency\", reload: @options.reload)).as(NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)))\n if reply[\"started\"].empty? && reply[\"stopped\"].empty?\n puts(\"Processes are running as configured\")\n else\n reply[\"started\"].each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n reply[\"stopped\"].each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","path":"Procodile/CLI/ConsoleCommand.html","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/console_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"console-instance-method","name":"console","abstract":false,"location":{"filename":"src/procodile/commands/console_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L9"},"def":{"name":"console","visibility":"Public","body":"if (cmd = @config.console_command)\n exec(cmd)\nelse\n raise(Error.new(\"No console command has been configured in the Procfile\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ExecCommand","path":"Procodile/CLI/ExecCommand.html","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/exec_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"exec(command=nil)-instance-method","name":"exec","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/exec_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L9"},"def":{"name":"exec","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"desired_command = command || (ARGV[1..].join(\" \"))\nif (prefix = @config.exec_prefix)\n desired_command = \"#{prefix} #{desired_command}\"\nend\nif desired_command.empty?\n raise(Error.new(\"You need to specify a command to run (e.g. procodile run -- rake db:migrate)\"))\nelse\n environment = @config.environment_variables\n if ENV[\"PROCODILE_EXEC_QUIET\"]?.try(&.to_i) == 1\n else\n puts(\"Running with #{desired_command.color(33)}\")\n environment.each do |key, value|\n puts(\" #{key.color(34)} #{value}\")\n end\n end\n begin\n Dir.cd(@config.root)\n ::Process.exec(desired_command, env: environment, shell: true)\n rescue e : RuntimeError\n raise(Error.new(e.message))\n end\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/HelpCommand","path":"Procodile/CLI/HelpCommand.html","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/help_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"help-instance-method","name":"help","abstract":false,"location":{"filename":"src/procodile/commands/help_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L9"},"def":{"name":"help","visibility":"Public","body":"puts(\"\\e[45;37mWelcome to Procodile v#{Procodile::VERSION}\\e[0m\")\nputs(\"For documentation see https://adam.ac/procodile.\")\nputs\nputs(\"The following commands are supported:\")\nputs\nself.class.commands.to_a.sort_by do |x|\n x[0]\nend.to_h.each do |method, options|\n if options.description\n puts(\" \\e[34m#{method.to_s.ljust(18, ' ')}\\e[0m #{options.description}\")\n end\nend\nputs\nputs(\"For details for the options available for each command, use the --help option.\")\nputs(\"For example 'procodile start --help'.\")\n"}}]},{"html_id":"procodile/Procodile/CLI/KillCommand","path":"Procodile/CLI/KillCommand.html","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/kill_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"kill-instance-method","name":"kill","abstract":false,"location":{"filename":"src/procodile/commands/kill_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L9"},"def":{"name":"kill","visibility":"Public","body":"Dir[File.join(@config.pid_root, \"*.pid\")].each do |pid_path|\n name = (pid_path.split('/')).last.rstrip(\".pid\")\n pid = (File.read(pid_path)).to_i\n begin\n ::Process.signal(Signal::INT, pid)\n puts(\"Sent KILL to #{pid} (#{name})\")\n rescue RuntimeError\n end\n FileUtils.rm(pid_path)\nend"}}]},{"html_id":"procodile/Procodile/CLI/LogCommand","path":"Procodile/CLI/LogCommand.html","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/log_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"log-instance-method","name":"log","abstract":false,"location":{"filename":"src/procodile/commands/log_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L20"},"def":{"name":"log","visibility":"Public","body":"opts = [] of String\nif options.wait\n opts << \"-f\"\nend\nif options.lines\n opts << \"-n #{options.lines}\"\nend\nprocess = options.process\nif process\n if ( process = @config.processes[process])\n log_path = process.log_path\n else\n raise(Error.new(\"Invalid process name '#{process}'\"))\n end\nelse\n log_path = @config.log_path\nend\nif File.exists?(log_path)\n ::Process.exec(\"tail #{opts.join(' ')} #{log_path}\", shell: true)\nelse\n raise(Error.new(\"No file found at #{log_path}\"))\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/ReloadCommand","path":"Procodile/CLI/ReloadCommand.html","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/reload_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/commands/reload_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L9"},"def":{"name":"reload","visibility":"Public","body":"if supervisor_running?\n ControlClient.run(@config.sock_path, \"reload_config\")\n puts(\"Reloaded Procodile config\")\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RestartCommand","path":"Procodile/CLI/RestartCommand.html","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/restart_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"restart-instance-method","name":"restart","abstract":false,"location":{"filename":"src/procodile/commands/restart_command.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L16"},"def":{"name":"restart","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"restart\", processes: process_names_from_cli_option, tag: @options.tag)).as(Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)))\n if instances.empty?\n puts(\"There are no processes to restart.\")\n else\n instances.each do |old_instance, new_instance|\n if old_instance && new_instance\n if old_instance.description == new_instance.description\n puts((\"Restarted\".color(35)) + \" #{old_instance.description}\")\n else\n puts((\"Restarted\".color(35)) + \" #{old_instance.description} -> #{new_instance.description}\")\n end\n else\n if old_instance\n puts((\"Stopped\".color(31)) + \" #{old_instance.description}\")\n else\n if new_instance\n puts((\"Started\".color(32)) + \" #{new_instance.description}\")\n end\n end\n end\n STDOUT.flush\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RunCommand","path":"Procodile/CLI/RunCommand.html","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/run_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"run(command=nil)-instance-method","name":"run","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/run_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L9"},"def":{"name":"run","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"exec(command)"}}]},{"html_id":"procodile/Procodile/CLI/StartCommand","path":"Procodile/CLI/StartCommand.html","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/start_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/commands/start_command.cr","line_number":59,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L59"},"def":{"name":"start","visibility":"Public","body":"if supervisor_running?\n if @options.foreground\n raise(Error.new(\"Cannot be started in the foreground because supervisor already running\"))\n end\n if @options.respawn\n raise(Error.new(\"Cannot disable respawning because supervisor is already running\"))\n end\n if @options.stop_when_none\n raise(Error.new(\"Cannot stop supervisor when none running because supervisor is already running\"))\n end\n if @options.proxy\n raise(Error.new(\"Cannot enable the proxy when the supervisor is running\"))\n end\n instances = (ControlClient.run(@config.sock_path, \"start_processes\", processes: process_names_from_cli_option, tag: @options.tag, port_allocations: @options.port_allocations)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes to start.\")\n else\n instances.each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n if @options.start_supervisor == false\n raise(Error.new(\"Supervisor is not running and cannot be started because --no-supervisor is set\"))\n else\n self.class.start_supervisor(@config, @options) do |supervisor|\n if @options.start_processes == false\n else\n supervisor.start_processes(process_names_from_cli_option, SupervisorOptions.new(tag: @options.tag))\n end\n end\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StatusCommand","path":"Procodile/CLI/StatusCommand.html","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/status_command.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"status-instance-method","name":"status","abstract":false,"location":{"filename":"src/procodile/commands/status_command.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L23"},"def":{"name":"status","visibility":"Public","body":"if supervisor_running?\n status = (ControlClient.run(@config.sock_path, \"status\")).as(ControlClientReplyForStatusCommand)\n if @options.json\n puts(status.to_json)\n else\n if @options.json_pretty\n puts(status)\n nil\n else\n if @options.simple\n if status.messages.empty?\n message = status.instances.map do |p, i|\n \"#{p}[#{i.size}]\"\n end\n puts(\"OK || #{message.join(\", \")}\")\n else\n message = status.messages.map do |p|\n Message.parse(p)\n end.join(\", \")\n puts(\"Issues || #{message}\")\n end\n else\n (StatusCLIOutput.new(status)).print_all\n end\n end\n end\nelse\n if @options.simple\n puts(\"NotRunning || Procodile supervisor isn't running\")\n else\n raise(Error.new(\"Procodile supervisor isn't running\"))\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StopCommand","path":"Procodile/CLI/StopCommand.html","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/stop_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"stop-instance-method","name":"stop","abstract":false,"location":{"filename":"src/procodile/commands/stop_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L20"},"def":{"name":"stop","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"stop\", processes: process_names_from_cli_option, stop_supervisor: @options.stop_supervisor)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes were stopped.\")\n else\n instances.each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\n if @options.stop_supervisor\n puts(\"Supervisor will be stopped when processes are stopped.\")\n end\n if @options.wait_until_supervisor_stopped\n puts(\"Waiting for supervisor to stop...\")\n loop do\n sleep(1)\n if supervisor_running?\n sleep(1)\n else\n puts(\"Supervisor has stopped\")\n exit(0)\n end\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]}]},{"html_id":"procodile/Procodile/CliCommand","path":"Procodile/CliCommand.html","kind":"struct","full_name":"Procodile::CliCommand","name":"CliCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,description:String|Nil,options:Proc(OptionParser,Procodile::CLI,Nil)|Nil,callable:Proc(Nil))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"args_string":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","args_html":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, description, options, callable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"callable:Proc(Nil)-instance-method","name":"callable","abstract":false,"def":{"name":"callable","return_type":"Proc(Nil)","visibility":"Public","body":"@callable"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @description.clone, @options.clone, @callable.clone)"}},{"html_id":"copy_with(name_name=@name,description_description=@description,options_options=@options,callable_callable=@callable)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"args_string":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","args_html":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _description, _options, _callable)"}},{"html_id":"description:String|Nil-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String | ::Nil","visibility":"Public","body":"@description"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"options:Proc(OptionParser,Procodile::CLI,Nil)|Nil-instance-method","name":"options","abstract":false,"def":{"name":"options","return_type":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil","visibility":"Public","body":"@options"}}]},{"html_id":"procodile/Procodile/CliOptions","path":"Procodile/CliOptions.html","kind":"struct","full_name":"Procodile::CliOptions","name":"CliOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":70,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L70"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":92,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L92"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clean:Bool|Nil-instance-method","name":"clean","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean","return_type":"Bool | ::Nil","visibility":"Public","body":"@clean"}},{"html_id":"clean=(clean:Bool|Nil)-instance-method","name":"clean=","abstract":false,"args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"args_string":"(clean : Bool | Nil)","args_html":"(clean : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean=","args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@clean = clean"}},{"html_id":"development:Bool|Nil-instance-method","name":"development","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L87"},"def":{"name":"development","return_type":"Bool | ::Nil","visibility":"Public","body":"@development"}},{"html_id":"development=(development:Bool|Nil)-instance-method","name":"development=","abstract":false,"args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"args_string":"(development : Bool | Nil)","args_html":"(development : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L87"},"def":{"name":"development=","args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@development = development"}},{"html_id":"foreground:Bool|Nil-instance-method","name":"foreground","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground","return_type":"Bool | ::Nil","visibility":"Public","body":"@foreground"}},{"html_id":"foreground=(foreground:Bool|Nil)-instance-method","name":"foreground=","abstract":false,"args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"args_string":"(foreground : Bool | Nil)","args_html":"(foreground : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground=","args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@foreground = foreground"}},{"html_id":"json:Bool|Nil-instance-method","name":"json","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L82"},"def":{"name":"json","return_type":"Bool | ::Nil","visibility":"Public","body":"@json"}},{"html_id":"json=(json:Bool|Nil)-instance-method","name":"json=","abstract":false,"args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"args_string":"(json : Bool | Nil)","args_html":"(json : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L82"},"def":{"name":"json=","args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json = json"}},{"html_id":"json_pretty:Bool|Nil-instance-method","name":"json_pretty","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty","return_type":"Bool | ::Nil","visibility":"Public","body":"@json_pretty"}},{"html_id":"json_pretty=(json_pretty:Bool|Nil)-instance-method","name":"json_pretty=","abstract":false,"args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"args_string":"(json_pretty : Bool | Nil)","args_html":"(json_pretty : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty=","args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json_pretty = json_pretty"}},{"html_id":"lines:Int32|Nil-instance-method","name":"lines","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines","return_type":"Int32 | ::Nil","visibility":"Public","body":"@lines"}},{"html_id":"lines=(lines:Int32|Nil)-instance-method","name":"lines=","abstract":false,"args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"args_string":"(lines : Int32 | Nil)","args_html":"(lines : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines=","args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@lines = lines"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L90"},"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"process=(process:String|Nil)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"args_string":"(process : String | Nil)","args_html":"(process : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L90"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"visibility":"Public","body":"@process = process"}},{"html_id":"processes:String|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes","return_type":"String | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:String|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"args_string":"(processes : String | Nil)","args_html":"(processes : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"reload=(reload:Bool|Nil)-instance-method","name":"reload=","abstract":false,"args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(reload : Bool | Nil)","args_html":"(reload : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload=","args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@reload = reload"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"simple:Bool|Nil-instance-method","name":"simple","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple","return_type":"Bool | ::Nil","visibility":"Public","body":"@simple"}},{"html_id":"simple=(simple:Bool|Nil)-instance-method","name":"simple=","abstract":false,"args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"args_string":"(simple : Bool | Nil)","args_html":"(simple : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple=","args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@simple = simple"}},{"html_id":"start_processes:Bool|Nil-instance-method","name":"start_processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_processes"}},{"html_id":"start_processes=(start_processes:Bool|Nil)-instance-method","name":"start_processes=","abstract":false,"args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"args_string":"(start_processes : Bool | Nil)","args_html":"(start_processes : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes=","args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_processes = start_processes"}},{"html_id":"start_supervisor:Bool|Nil-instance-method","name":"start_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_supervisor"}},{"html_id":"start_supervisor=(start_supervisor:Bool|Nil)-instance-method","name":"start_supervisor=","abstract":false,"args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(start_supervisor : Bool | Nil)","args_html":"(start_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor=","args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_supervisor = start_supervisor"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"stop_supervisor=(stop_supervisor:Bool|Nil)-instance-method","name":"stop_supervisor=","abstract":false,"args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(stop_supervisor : Bool | Nil)","args_html":"(stop_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor=","args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_supervisor = stop_supervisor"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}},{"html_id":"tag=(tag:String|Nil)-instance-method","name":"tag=","abstract":false,"args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"args_string":"(tag : String | Nil)","args_html":"(tag : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag=","args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"visibility":"Public","body":"@tag = tag"}},{"html_id":"wait:Bool|Nil-instance-method","name":"wait","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait"}},{"html_id":"wait=(wait:Bool|Nil)-instance-method","name":"wait=","abstract":false,"args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"args_string":"(wait : Bool | Nil)","args_html":"(wait : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait=","args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait = wait"}},{"html_id":"wait_until_supervisor_stopped:Bool|Nil-instance-method","name":"wait_until_supervisor_stopped","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait_until_supervisor_stopped"}},{"html_id":"wait_until_supervisor_stopped=(wait_until_supervisor_stopped:Bool|Nil)-instance-method","name":"wait_until_supervisor_stopped=","abstract":false,"args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"args_string":"(wait_until_supervisor_stopped : Bool | Nil)","args_html":"(wait_until_supervisor_stopped : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped=","args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait_until_supervisor_stopped = wait_until_supervisor_stopped"}}]},{"html_id":"procodile/Procodile/Config","path":"Procodile/Config.html","kind":"class","full_name":"Procodile::Config","name":"Config","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/config.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COLORS","name":"COLORS","value":"[35, 31, 36, 32, 33, 34]","doc":"35 紫,31 红,36 青,32 绿,33 橘,34 蓝","summary":"

35 紫,31 红,36 青,32 绿,33 橘,34 蓝

"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(root:String,procfile:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(root : String, procfile : String | Nil = nil)","args_html":"(root : String, procfile : String | Nil = nil)","location":{"filename":"src/procodile/config.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L20"},"def":{"name":"new","args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(root, procfile)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":95,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L95"},"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name || (@app_name = (local_options.app_name || options.app_name) || \"Procodile\")"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":99,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L99"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"local_options.console_command || options.console_command"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L138"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"option_env = options.env || ({} of String => String)\nlocal_option_env = local_options.env || ({} of String => String)\noption_env.merge(local_option_env)\n"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":103,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L103"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"local_options.exec_prefix || options.exec_prefix"}},{"html_id":"loaded_at:Time?-instance-method","name":"loaded_at","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L18"},"def":{"name":"loaded_at","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options:ProcfileOption-instance-method","name":"local_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":119,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L119"},"def":{"name":"local_options","return_type":"ProcfileOption","visibility":"Public","body":"@local_options || (@local_options = load_local_options_from_file)"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":182,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L182"},"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.local\""}},{"html_id":"local_process_options:Hash(String,ProcessOption)-instance-method","name":"local_process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":127,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L127"},"def":{"name":"local_process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@local_process_options || (@local_process_options = local_options.processes || ({} of String => ProcessOption))"}},{"html_id":"log_path:String-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L152"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = local_options.log_path || options.log_path\nif log_path\n File.expand_path(log_path, self.root)\nelse\n if log_path.nil? && self.log_root\n File.join(self.log_root.not_nil!, \"procodile.log\")\n else\n File.expand_path(\"procodile.log\", self.root)\n end\nend\n"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":164,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L164"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"log_root = local_options.log_root || options.log_root\nif log_root\n File.expand_path(log_root, self.root)\nend\n"}},{"html_id":"options:ProcfileOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":115,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L115"},"def":{"name":"options","return_type":"ProcfileOption","visibility":"Public","body":"@options || (@options = load_options_from_file)"}},{"html_id":"options_for_process(name):ProcessOption-instance-method","name":"options_for_process","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name) : ProcessOption","args_html":"(name) : ProcessOption","location":{"filename":"src/procodile/config.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L131"},"def":{"name":"options_for_process","args":[{"name":"name","external_name":"name","restriction":""}],"return_type":"ProcessOption","visibility":"Public","body":"po = process_options[name]? || ProcessOption.new\nlocal_po = local_process_options[name]? || ProcessOption.new\npo.merge(local_po)\n"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":178,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L178"},"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.options\""}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":144,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L144"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"File.expand_path((local_options.pid_root || options.pid_root) || \"pids\", self.root)"}},{"html_id":"process_list:Hash(String,String)-instance-method","name":"process_list","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":111,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L111"},"def":{"name":"process_list","return_type":"Hash(String, String)","visibility":"Public","body":"@process_list || (@process_list = load_process_list_from_file)"}},{"html_id":"process_options:Hash(String,ProcessOption)-instance-method","name":"process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":123,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L123"},"def":{"name":"process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@process_options || (@process_options = options.processes || ({} of String => ProcessOption))"}},{"html_id":"processes:Hash(String,Procodile::Process)-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L107"},"def":{"name":"processes","return_type":"Hash(String, Procodile::Process)","visibility":"Public","body":"@processes || (@processes = {} of String => Procodile::Process)"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":174,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L174"},"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path || (File.join(self.root, \"Procfile\"))"}},{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":47,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L47"},"def":{"name":"reload","visibility":"Public","body":"@process_list = nil\n@options = nil\n@local_options = nil\n@process_options = nil\n@local_process_options = nil\n@loaded_at = nil\n@environment_variables = nil\nif (processes = @processes)\n process_list.each do |name, command|\n if ( process = processes[name]?)\n process.removed = false\n if process.command != command\n process.command = command\n Procodile.log(nil, \"system\", \"#{name} command has changed. Updated.\")\n end\n process.options = options_for_process(name)\n else\n Procodile.log(nil, \"system\", \"#{name} has been added to the Procfile.\")\n processes[name] = create_process(name, command, COLORS[(processes.size.divmod(COLORS.size))[1]])\n end\n end\n removed_processes = processes.keys - process_list.keys\n removed_processes.each do |process_name|\n if ( p = (processes[process_name]))\n p.removed = true\n processes.delete(process_name)\n Procodile.log(nil, \"system\", \"#{process_name} has been removed in the Procfile. It will be removed when it is stopped.\")\n end\n end\nend\n@loaded_at = Time.local\n"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L18"},"def":{"name":"root","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L170"},"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.sock\")"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":148,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L148"},"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.pid\")"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":91,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L91"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"local_options.user || options.user"}}]},{"html_id":"procodile/Procodile/ControlClient","path":"Procodile/ControlClient.html","kind":"class","full_name":"Procodile::ControlClient","name":"ControlClient","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_client.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"run(sock_path:String,command:String,**options)-class-method","name":"run","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"args_string":"(sock_path : String, command : String, **options)","args_html":"(sock_path : String, command : String, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L18"},"def":{"name":"run","args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"begin\n socket = self.new(sock_path)\n socket.run(command, **options)\nensure\n socket.try(&.disconnect)\nend"}}],"constructors":[{"html_id":"new(sock_path,block:Proc(ControlClient,Nil)|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"args_string":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","args_html":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","location":{"filename":"src/procodile/control_client.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L6"},"def":{"name":"new","args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(sock_path, block)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"disconnect-instance-method","name":"disconnect","abstract":false,"location":{"filename":"src/procodile/control_client.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L53"},"def":{"name":"disconnect","visibility":"Public","body":"@socket.try(&.close)"}},{"html_id":"run(command,**options)-instance-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command, **options)","args_html":"(command, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L25"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"@socket.puts(\"#{command} #{options.to_json}\")\nif (data = @socket.gets)\n code, reply = data.strip.split(/\\s+/, 2)\n if code.to_i == 200\n if reply && (!reply.empty?)\n case command\n when \"start_processes\", \"stop\"\n Array(InstanceConfig).from_json(reply)\n when \"restart\"\n Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)).from_json(reply)\n when \"check_concurrency\"\n NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)).from_json(reply)\n when \"status\"\n ControlClientReplyForStatusCommand.from_json(reply)\n end\n else\n true\n end\n else\n raise(Error.new(\"Error from control server: #{code} (#{reply.inspect})\"))\n end\nelse\n raise(Error.new(\"Control server disconnected.\"))\nend\n"}}]},{"html_id":"procodile/Procodile/ControlClientProcessStatus","path":"Procodile/ControlClientProcessStatus.html","kind":"struct","full_name":"Procodile::ControlClientProcessStatus","name":"ControlClientProcessStatus","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,log_color:Int32,quantity:Int32,max_respawns:Int32,respawn_window:Int32,command:String,restart_mode:Signal|String|Nil,log_path:String|Nil,removed:Bool,proxy_port:Int32|Nil,proxy_address:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","args_html":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, log_color, quantity, max_respawns, respawn_window, command, restart_mode, log_path, removed, proxy_port, proxy_address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":137,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L137"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @log_color.clone, @quantity.clone, @max_respawns.clone, @respawn_window.clone, @command.clone, @restart_mode.clone, @log_path.clone, @removed.clone, @proxy_port.clone, @proxy_address.clone)"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"def":{"name":"command","return_type":"String","visibility":"Public","body":"@command"}},{"html_id":"copy_with(name_name=@name,log_color_log_color=@log_color,quantity_quantity=@quantity,max_respawns_max_respawns=@max_respawns,respawn_window_respawn_window=@respawn_window,command_command=@command,restart_mode_restart_mode=@restart_mode,log_path_log_path=@log_path,removed_removed=@removed,proxy_port_proxy_port=@proxy_port,proxy_address_proxy_address=@proxy_address)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"args_string":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","args_html":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _log_color, _quantity, _max_respawns, _respawn_window, _command, _restart_mode, _log_path, _removed, _proxy_port, _proxy_address)"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"def":{"name":"log_color","return_type":"Int32","visibility":"Public","body":"@log_color"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","abstract":false,"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@max_respawns"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","abstract":false,"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@quantity"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"def":{"name":"removed","return_type":"Bool","visibility":"Public","body":"@removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","abstract":false,"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}}]},{"html_id":"procodile/Procodile/ControlClientReplyForStatusCommand","path":"Procodile/ControlClientReplyForStatusCommand.html","kind":"struct","full_name":"Procodile::ControlClientReplyForStatusCommand","name":"ControlClientReplyForStatusCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(version:String,messages:Array(SupervisorMessages),root:String,app_name:String,supervisor:NamedTuple(started_at:Int64,pid:Int64),instances:Hash(String,Array(InstanceConfig)),processes:Array(ControlClientProcessStatus),environment_variables:Hash(String,String),procfile_path:String,options_path:String,local_options_path:String,sock_path:String,supervisor_pid_path:String,pid_root:String,loaded_at:Int64,log_root:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","args_html":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"new","args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(version, messages, root, app_name, supervisor, instances, processes, environment_variables, procfile_path, options_path, local_options_path, sock_path, supervisor_pid_path, pid_root, loaded_at, log_root)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":167,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L167"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@version.clone, @messages.clone, @root.clone, @app_name.clone, @supervisor.clone, @instances.clone, @processes.clone, @environment_variables.clone, @procfile_path.clone, @options_path.clone, @local_options_path.clone, @sock_path.clone, @supervisor_pid_path.clone, @pid_root.clone, @loaded_at.clone, @log_root.clone)"}},{"html_id":"copy_with(version_version=@version,messages_messages=@messages,root_root=@root,app_name_app_name=@app_name,supervisor_supervisor=@supervisor,instances_instances=@instances,processes_processes=@processes,environment_variables_environment_variables=@environment_variables,procfile_path_procfile_path=@procfile_path,options_path_options_path=@options_path,local_options_path_local_options_path=@local_options_path,sock_path_sock_path=@sock_path,supervisor_pid_path_supervisor_pid_path=@supervisor_pid_path,pid_root_pid_root=@pid_root,loaded_at_loaded_at=@loaded_at,log_root_log_root=@log_root)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"args_string":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","args_html":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"copy_with","args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"visibility":"Public","body":"self.class.new(_version, _messages, _root, _app_name, _supervisor, _instances, _processes, _environment_variables, _procfile_path, _options_path, _local_options_path, _sock_path, _supervisor_pid_path, _pid_root, _loaded_at, _log_root)"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"@environment_variables"}},{"html_id":"instances:Hash(String,Array(InstanceConfig))-instance-method","name":"instances","abstract":false,"def":{"name":"instances","return_type":"Hash(String, Array(InstanceConfig))","visibility":"Public","body":"@instances"}},{"html_id":"loaded_at:Int64-instance-method","name":"loaded_at","abstract":false,"def":{"name":"loaded_at","return_type":"Int64","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"@local_options_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"@messages"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"@options_path"}},{"html_id":"pid_root:String-instance-method","name":"pid_root","abstract":false,"def":{"name":"pid_root","return_type":"String","visibility":"Public","body":"@pid_root"}},{"html_id":"processes:Array(ControlClientProcessStatus)-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(ControlClientProcessStatus)","visibility":"Public","body":"@processes"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"def":{"name":"root","return_type":"String","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"@sock_path"}},{"html_id":"supervisor:NamedTuple(started_at:Int64,pid:Int64)-instance-method","name":"supervisor","abstract":false,"def":{"name":"supervisor","return_type":"NamedTuple(started_at: Int64, pid: Int64)","visibility":"Public","body":"@supervisor"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"@supervisor_pid_path"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"procodile/Procodile/ControlServer","path":"Procodile/ControlServer.html","kind":"class","full_name":"Procodile::ControlServer","name":"ControlServer","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_server.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/control_server.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L6"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"begin\n sock_path = supervisor.config.sock_path\n spawn do\n server = UNIXServer.new(sock_path)\n Procodile.log(nil, \"control\", \"Listening at #{sock_path}\")\n loop do\n client = server.accept\n session = ControlSession.new(supervisor, client)\n while ( line = client.gets)\n if ( response = session.receive_data(line.strip))\n client.puts(response)\n end\n end\n client.close\n end\n end\nensure\n FileUtils.rm_rf(sock_path.not_nil!)\nend"}}]},{"html_id":"procodile/Procodile/ControlSession","path":"Procodile/ControlSession.html","kind":"class","full_name":"Procodile::ControlSession","name":"ControlSession","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_session.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,client:UNIXSocket)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"args_string":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","args_html":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","location":{"filename":"src/procodile/control_session.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L6"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, client)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"check_concurrency(options):String-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L55"},"def":{"name":"check_concurrency","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"result = @supervisor.check_concurrency(SupervisorOptions.new(reload: options.reload))\nresult = result.transform_values do |instances|\n instances.map(&.to_hash)\nend\n\"200 #{result.to_json}\"\n"}},{"html_id":"receive_data(data)-instance-method","name":"receive_data","abstract":false,"args":[{"name":"data","external_name":"data","restriction":""}],"args_string":"(data)","args_html":"(data)","location":{"filename":"src/procodile/control_session.cr","line_number":100,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L100"},"def":{"name":"receive_data","args":[{"name":"data","external_name":"data","restriction":""}],"visibility":"Public","body":"command, _options = data.split(/\\s+/, 2)\noptions = ControlSessionData.from_json(_options)\ncallable = {} of String => Proc(ControlSessionData, String)\ncallable[\"start_processes\"] = ->start_processes(ControlSessionData)\ncallable[\"stop\"] = ->stop(ControlSessionData)\ncallable[\"restart\"] = ->restart(ControlSessionData)\ncallable[\"reload_config\"] = ->reload_config(ControlSessionData)\ncallable[\"check_concurrency\"] = ->check_concurrency(ControlSessionData)\ncallable[\"status\"] = ->status(ControlSessionData)\nif callable[command]?\n begin\n callable[command].call(options)\n rescue e : Procodile::Error\n Procodile.log(nil, \"control\", \"Error: #{e.message}\".color(31))\n \"500 #{e.message}\"\n end\nelse\n \"404 Invaid command\"\nend\n"}},{"html_id":"reload_config(options):String-instance-method","name":"reload_config","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L49"},"def":{"name":"reload_config","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"@supervisor.reload_config\n\"200 []\"\n"}},{"html_id":"restart(options):String-instance-method","name":"restart","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":38,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L38"},"def":{"name":"restart","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.restart(SupervisorOptions.new(processes: options.processes, tag: options.tag))\n\"200 \" + instances.map do |a|\n a.map do |i|\n i ? i.to_hash : nil\n end\nend.to_json\n"}},{"html_id":"start_processes(options):String-instance-method","name":"start_processes","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L9"},"def":{"name":"start_processes","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"if options.port_allocations\n run_options_port_allocations = @supervisor.run_options.port_allocations\n if run_options_port_allocations\n run_options_port_allocations.merge!(options.port_allocations.not_nil!)\n else\n @supervisor.run_options.port_allocations = options.port_allocations\n end\nend\ninstances = @supervisor.start_processes(options.processes, SupervisorOptions.new(tag: options.tag))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}},{"html_id":"status(options):String-instance-method","name":"status","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L66"},"def":{"name":"status","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = {} of String => Array(Procodile::InstanceConfig)\n@supervisor.processes.each do |process, process_instances|\n instances[process.name] = [] of Procodile::InstanceConfig\n process_instances.each do |instance|\n instances[process.name] << instance.to_hash\n end\nend\nprocesses = @supervisor.processes.keys.map(&.to_hash)\nresult = ControlClientReplyForStatusCommand.new(version: Procodile::VERSION, messages: @supervisor.messages, root: @supervisor.config.root, app_name: @supervisor.config.app_name, supervisor: @supervisor.to_hash, instances: instances, processes: processes, environment_variables: @supervisor.config.environment_variables, procfile_path: @supervisor.config.procfile_path, options_path: @supervisor.config.options_path, local_options_path: @supervisor.config.local_options_path, sock_path: @supervisor.config.sock_path, log_root: @supervisor.config.log_root, supervisor_pid_path: @supervisor.config.supervisor_pid_path, pid_root: @supervisor.config.pid_root, loaded_at: @supervisor.config.loaded_at.not_nil!.to_unix)\n\"200 #{result.to_json}\"\n"}},{"html_id":"stop(options):String-instance-method","name":"stop","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L27"},"def":{"name":"stop","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.stop(SupervisorOptions.new(processes: options.processes, stop_supervisor: options.stop_supervisor))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}}]},{"html_id":"procodile/Procodile/ControlSessionData","path":"Procodile/ControlSessionData.html","kind":"struct","full_name":"Procodile::ControlSessionData","name":"ControlSessionData","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=[]ofString,tag:String|Nil=nil,port_allocations:Hash(String,Int32)|Nil=nil,reload:Bool|Nil=nil,stop_supervisor:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"new","args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, tag, port_allocations, reload, stop_supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":102,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L102"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @tag.clone, @port_allocations.clone, @reload.clone, @stop_supervisor.clone)"}},{"html_id":"copy_with(processes_processes=@processes,tag_tag=@tag,port_allocations_port_allocations=@port_allocations,reload_reload=@reload,stop_supervisor_stop_supervisor=@stop_supervisor)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"args_string":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","args_html":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _tag, _port_allocations, _reload, _stop_supervisor)"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Error","path":"Procodile/Error.html","kind":"class","full_name":"Procodile::Error","name":"Error","abstract":false,"superclass":{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/error.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/error.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"}},{"html_id":"procodile/Procodile/Instance","path":"Procodile/Instance.html","kind":"class","full_name":"Procodile::Instance","name":"Instance","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/instance.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,process:Procodile::Process,id:Int32)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"args_string":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","args_html":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","location":{"filename":"src/procodile/instance.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L17"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, process, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_respawn:Int32-instance-method","name":"add_respawn","doc":"\nIncrement the counter of respawns for this process\n","summary":"

Increment the counter of respawns for this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":356,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L356"},"def":{"name":"add_respawn","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif last_respawn && last_respawn < (Time.local - @process.respawn_window.seconds)\n @respawns = 1\nelse\n @last_respawn = Time.local\n @respawns = @respawns + 1\nend\n"}},{"html_id":"allocate_port(max_attempts=10)-instance-method","name":"allocate_port","doc":"\nFind a port number for this instance to listen on. We just check that nothing is already listening on it.\nThe process is expected to take it straight away if it wants it.\n","summary":"

Find a port number for this instance to listen on.

","abstract":false,"args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"args_string":"(max_attempts = 10)","args_html":"(max_attempts = 10)","location":{"filename":"src/procodile/instance.cr","line_number":389,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L389"},"def":{"name":"allocate_port","args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"visibility":"Public","body":"attempts = 0\nwhile !@port\n attempts = attempts + 1\n possible_port = rand(20000..29999)\n if self.port_available?(possible_port)\n Procodile.log(@process.log_color, description, \"Allocated port as #{possible_port}\")\n @port = possible_port\n else\n if attempts >= max_attempts\n raise(Procodile::Error.new(\"Couldn't allocate port for #{process.name}\"))\n end\n end\nend\n"}},{"html_id":"can_respawn?:Bool-instance-method","name":"can_respawn?","doc":"\nCan this process be respawned if needed?\n","summary":"

Can this process be respawned if needed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":336,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L336"},"def":{"name":"can_respawn?","return_type":"Bool","visibility":"Public","body":"(!stopping?) && (respawns + 1) <= @process.max_respawns"}},{"html_id":"check(options={}ofString=>String)-instance-method","name":"check","doc":"\nCheck the status of this process and handle as appropriate.\n","summary":"

Check the status of this process and handle as appropriate.

","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String)","args_html":"(options = {} of String => String)","location":{"filename":"src/procodile/instance.cr","line_number":303,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L303"},"def":{"name":"check","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"visibility":"Public","body":"if failed?\n return\nend\nif self.running?\n true\nelse\n if update_pid\n return check\n end\n if @supervisor.allow_respawning?\n if can_respawn?\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning...\")\n start\n add_respawn\n else\n if respawns >= @process.max_respawns\n Procodile.log(@process.log_color, description, \"\\e[41;37mWarning:\\e[0m\\e[31m this process has been respawned #{respawns} times and keeps dying.\\e[0m\")\n Procodile.log(@process.log_color, description, \"It will not be respawned automatically any longer and will no longer be managed.\".color(31))\n @failed = Time.local\n tidy\n end\n end\n else\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning not available.\")\n @failed = Time.local\n tidy\n end\nend\n"}},{"html_id":"description-instance-method","name":"description","doc":"\nReturn a description for this instance\n","summary":"

Return a description for this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":26,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L26"},"def":{"name":"description","visibility":"Public","body":"\"#{@process.name}.#{@id}\""}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn an array of environment variables that should be set\n","summary":"

Return an array of environment variables that should be set

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L57"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"vars = @process.environment_variables.merge({\"PROC_NAME\" => self.description, \"PID_FILE\" => self.pid_file_path, \"APP_ROOT\" => @process.config.root})\nif @port\n vars[\"PORT\"] = @port.to_s\nend\nvars\n"}},{"html_id":"failed?:Bool-instance-method","name":"failed?","doc":"\nHas this failed?\n","summary":"

Has this failed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":202,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L202"},"def":{"name":"failed?","return_type":"Bool","visibility":"Public","body":"@failed ? true : false"}},{"html_id":"id:Int32-instance-method","name":"id","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L15"},"def":{"name":"id","visibility":"Public","body":"@id"}},{"html_id":"on_stop-instance-method","name":"on_stop","doc":"\nA method that will be called when this instance has been stopped and it isn't going to be\nstarted again\n","summary":"

A method that will be called when this instance has been stopped and it isn't going to be started again

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":226,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L226"},"def":{"name":"on_stop","visibility":"Public","body":"@started_at = nil\n@stopped = true\ntidy\n"}},{"html_id":"pid:Int64-instance-method","name":"pid","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"pid","visibility":"Public","body":"@pid"}},{"html_id":"pid=(pid:Int64)-instance-method","name":"pid=","abstract":false,"args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"args_string":"(pid : Int64)","args_html":"(pid : Int64)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"pid=","args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"visibility":"Public","body":"@pid = pid"}},{"html_id":"pid_file_path:String-instance-method","name":"pid_file_path","doc":"\nReturn the path to this instance's PID file\n","summary":"

Return the path to this instance's PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L71"},"def":{"name":"pid_file_path","return_type":"String","visibility":"Public","body":"File.join(@process.config.pid_root, \"#{description}.pid\")"}},{"html_id":"pid_from_file:Int64|Nil-instance-method","name":"pid_from_file","doc":"\nReturn the PID that is in the instances process PID file\n","summary":"

Return the PID that is in the instances process PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L78"},"def":{"name":"pid_from_file","return_type":"Int64 | ::Nil","visibility":"Public","body":"if File.exists?(pid_file_path)\n pid = File.read(pid_file_path)\n pid.empty? ? nil : pid.strip.to_i64\nend"}},{"html_id":"port:Int32?-instance-method","name":"port","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"port","visibility":"Public","body":"@port"}},{"html_id":"port=(port:Int32|Nil)-instance-method","name":"port=","abstract":false,"args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"args_string":"(port : Int32 | Nil)","args_html":"(port : Int32 | Nil)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"port=","args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"@port = port"}},{"html_id":"port_available?(port):Bool-instance-method","name":"port_available?","doc":"\nIs the given port available?\n","summary":"

Is the given port available?

","abstract":false,"args":[{"name":"port","external_name":"port","restriction":""}],"args_string":"(port) : Bool","args_html":"(port) : Bool","location":{"filename":"src/procodile/instance.cr","line_number":408,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L408"},"def":{"name":"port_available?","args":[{"name":"port","external_name":"port","restriction":""}],"return_type":"Bool","visibility":"Public","body":"begin\n case @process.network_protocol\n when \"tcp\"\n server = TCPServer.new(\"127.0.0.1\", port)\n server.close\n true\n when \"udp\"\n server = UDPSocket.new\n server.bind(\"127.0.0.1\", port)\n server.close\n true\n else\n raise(Procodile::Error.new(\"Invalid network_protocol '#{@process.network_protocol}'\"))\n end\nrescue Socket::BindError\n false\nend"}},{"html_id":"process:Procodile::Process-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"process","visibility":"Public","body":"@process"}},{"html_id":"process=(process:Procodile::Process)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"args_string":"(process : Procodile::Process)","args_html":"(process : Procodile::Process)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"visibility":"Public","body":"@process = process"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","doc":"\nReturn the number of times this process has been respawned in the last hour\n","summary":"

Return the number of times this process has been respawned in the last hour

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":343,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L343"},"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif (@respawns.nil? || last_respawn.nil?) || last_respawn < (Time.local - @process.respawn_window.seconds)\n 0\nelse\n @respawns\nend\n"}},{"html_id":"restart:self|Nil-instance-method","name":"restart","doc":"\nRetarts the process using the appropriate method from the process configuration\n","summary":"

Retarts the process using the appropriate method from the process configuration

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":243,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L243"},"def":{"name":"restart","return_type":"self | ::Nil","visibility":"Public","body":"restart_mode = @process.restart_mode\nProcodile.log(@process.log_color, description, \"Restarting using #{restart_mode} mode\")\nupdate_pid\ncase restart_mode\nwhen Signal::USR1, Signal::USR2\n if running?\n ::Process.signal(restart_mode.as(Signal), @pid)\n if @supervisor.tag\n @tag = @supervisor.tag\n end\n Procodile.log(@process.log_color, description, \"Sent #{restart_mode.to_s.upcase} signal to process #{@pid}\")\n else\n Procodile.log(@process.log_color, description, \"Process not running already. Starting it.\")\n on_stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n new_instance.start\n end\n self\nwhen \"start-term\"\n new_instance = @process.create_instance(@supervisor)\n new_instance.start\n stop\n new_instance\nwhen \"term-start\"\n stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n spawn do\n while running?\n sleep(0.5)\n end\n new_instance.start\n end\n new_instance\nend\n"}},{"html_id":"running?:Bool-instance-method","name":"running?","doc":"\nIs this process running? Pass an option to check the given PID instead of the instance\n","summary":"

Is this process running? Pass an option to check the given PID instead of the instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L88"},"def":{"name":"running?","return_type":"Bool","visibility":"Public","body":"begin\n if ( pid = @pid)\n ::Process.pgid(pid) ? true : false\n else\n false\n end\nrescue RuntimeError\n false\nend"}},{"html_id":"should_be_running?:Bool-instance-method","name":"should_be_running?","doc":"\nShould this process be running?\n","summary":"

Should this process be running?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L50"},"def":{"name":"should_be_running?","return_type":"Bool","visibility":"Public","body":"!(stopped? || stopping?)"}},{"html_id":"start-instance-method","name":"start","doc":"\nStart a new instance of this process\n","summary":"

Start a new instance of this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":101,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L101"},"def":{"name":"start","visibility":"Public","body":"if stopping?\n Procodile.log(@process.log_color, description, \"Process is stopped/stopping therefore cannot be started again.\")\n return false\nend\nupdate_pid\nif running?\n Procodile.log(@process.log_color, description, \"Already running with PID #{@pid}\")\n nil\nelse\n port_allocations = @supervisor.run_options.port_allocations\n if port_allocations && (chosen_port = port_allocations[@process.name]?)\n if chosen_port == 0\n allocate_port\n else\n @port = chosen_port\n Procodile.log(@process.log_color, description, \"Assigned #{chosen_port} to process\")\n end\n else\n if @process.proxy? && @supervisor.tcp_proxy\n allocate_port\n else\n if (proposed_port = @process.allocate_port_from) && (@process.restart_mode != \"start-term\")\n process = @supervisor.processes[@process]\n allocated_ports = process ? process.select(&.running?).map(&.port) : [] of Int32\n while !@port\n if allocated_ports.includes?(proposed_port)\n else\n @port = proposed_port\n end\n proposed_port = proposed_port + 1\n end\n end\n end\n end\n if self.process.log_path && (@supervisor.run_options.force_single_log != true)\n FileUtils.mkdir_p(File.dirname(self.process.log_path))\n log_destination = File.open(self.process.log_path, \"a\")\n io = nil\n else\n reader, writer = IO.pipe\n log_destination = writer\n io = reader\n end\n if @supervisor.tag\n @tag = @supervisor.tag.dup\n end\n Dir.cd(@process.config.root)\n commands = @process.command.split(\" \")\n process = ::Process.new(command: commands[0], args: commands[1..], env: environment_variables, output: log_destination, error: log_destination)\n @pid = process.pid\n log_destination.close\n File.write(pid_file_path, \"#{@pid}\\n\")\n @supervisor.add_instance(self, io)\n spawn do\n process.wait\n end\n Procodile.log(@process.log_color, description, \"Started with PID #{@pid}\" + (@tag ? \" (tagged with #{@tag})\" : \"\"))\n if self.process.log_path && io.nil?\n Procodile.log(@process.log_color, description, \"Logging to #{self.process.log_path}\")\n end\n @started_at = Time.local\nend\n"}},{"html_id":"status:String-instance-method","name":"status","doc":"\nReturn the status of this instance\n","summary":"

Return the status of this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":33,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L33"},"def":{"name":"status","return_type":"String","visibility":"Public","body":"if stopped?\n \"Stopped\"\nelse\n if stopping?\n \"Stopping\"\n else\n if running?\n \"Running\"\n else\n if failed?\n \"Failed\"\n else\n \"Unknown\"\n end\n end\n end\nend"}},{"html_id":"stop-instance-method","name":"stop","doc":"\nSend this signal the signal to stop and mark the instance in a state that\ntells us that we want it to be stopped.\n","summary":"

Send this signal the signal to stop and mark the instance in a state that tells us that we want it to be stopped.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":210,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L210"},"def":{"name":"stop","visibility":"Public","body":"@stopping = Time.local\nupdate_pid\nif self.running?\n Procodile.log(@process.log_color, description, \"Sending #{@process.term_signal} to #{@pid}\")\n ::Process.signal(@process.term_signal, pid.not_nil!)\nelse\n Procodile.log(@process.log_color, description, \"Process already stopped\")\nend\n"}},{"html_id":"stopped?:Bool-instance-method","name":"stopped?","doc":"\nIs this stopped?\n","summary":"

Is this stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":195,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L195"},"def":{"name":"stopped?","return_type":"Bool","visibility":"Public","body":"@stopped || false"}},{"html_id":"stopping?:Bool-instance-method","name":"stopping?","doc":"\nIs this instance supposed to be stopping/be stopped?\n","summary":"

Is this instance supposed to be stopping/be stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":188,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L188"},"def":{"name":"stopping?","return_type":"Bool","visibility":"Public","body":"@stopping ? true : false"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L15"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tidy-instance-method","name":"tidy","doc":"\nTidy up when this process isn't needed any more\n","summary":"

Tidy up when this process isn't needed any more

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":235,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L235"},"def":{"name":"tidy","visibility":"Public","body":"FileUtils.rm_rf(self.pid_file_path)\nProcodile.log(@process.log_color, description, \"Removed PID file\")\n"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn this instance as a hash\n","summary":"

Return this instance as a hash

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":370,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L370"},"def":{"name":"to_hash","visibility":"Public","body":"started_at = @started_at\nInstanceConfig.new(description: self.description, pid: self.pid, respawns: self.respawns, status: self.status, running: self.running?, started_at: started_at ? started_at.to_unix : nil, tag: self.tag, port: @port)\n"}},{"html_id":"update_pid:Bool-instance-method","name":"update_pid","doc":"\nUpdate the locally cached PID from that stored on the file system.\n","summary":"

Update the locally cached PID from that stored on the file system.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":288,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L288"},"def":{"name":"update_pid","return_type":"Bool","visibility":"Public","body":"pid_from_file = self.pid_from_file\nif pid_from_file && (pid_from_file != @pid)\n @pid = pid_from_file\n @started_at = (File.info(self.pid_file_path)).modification_time\n Procodile.log(@process.log_color, description, \"PID file changed. Updated pid to #{@pid}\")\n true\nelse\n false\nend\n"}}]},{"html_id":"procodile/Procodile/InstanceConfig","path":"Procodile/InstanceConfig.html","kind":"struct","full_name":"Procodile::InstanceConfig","name":"InstanceConfig","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(description:String,pid:Int64|Nil,respawns:Int32,status:String,running:Bool,started_at:Int64|Nil,tag:String|Nil,port:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"args_string":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","args_html":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"new","args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(description, pid, respawns, status, running, started_at, tag, port)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":122,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L122"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@description.clone, @pid.clone, @respawns.clone, @status.clone, @running.clone, @started_at.clone, @tag.clone, @port.clone)"}},{"html_id":"copy_with(description_description=@description,pid_pid=@pid,respawns_respawns=@respawns,status_status=@status,running_running=@running,started_at_started_at=@started_at,tag_tag=@tag,port_port=@port)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"args_string":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","args_html":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"copy_with","args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"visibility":"Public","body":"self.class.new(_description, _pid, _respawns, _status, _running, _started_at, _tag, _port)"}},{"html_id":"description:String-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String","visibility":"Public","body":"@description"}},{"html_id":"pid:Int64|Nil-instance-method","name":"pid","abstract":false,"def":{"name":"pid","return_type":"Int64 | ::Nil","visibility":"Public","body":"@pid"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","abstract":false,"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"@respawns"}},{"html_id":"running:Bool-instance-method","name":"running","abstract":false,"def":{"name":"running","return_type":"Bool","visibility":"Public","body":"@running"}},{"html_id":"started_at:Int64|Nil-instance-method","name":"started_at","abstract":false,"def":{"name":"started_at","return_type":"Int64 | ::Nil","visibility":"Public","body":"@started_at"}},{"html_id":"status:String-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String","visibility":"Public","body":"@status"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Message","path":"Procodile/Message.html","kind":"module","full_name":"Procodile::Message","name":"Message","abstract":false,"locations":[{"filename":"src/procodile/message.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"parse(message)-class-method","name":"parse","abstract":false,"args":[{"name":"message","external_name":"message","restriction":""}],"args_string":"(message)","args_html":"(message)","location":{"filename":"src/procodile/message.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L3"},"def":{"name":"parse","args":[{"name":"message","external_name":"message","restriction":""}],"visibility":"Public","body":"case message.type\nwhen \"not_running\"\n \"#{message.instance} is not running (#{message.status})\"\nwhen \"incorrect_quantity\"\n \"#{message.process} only has #{message.current} instances (should have #{message.desired})\"\nend"}}]},{"html_id":"procodile/Procodile/Process","path":"Procodile/Process.html","kind":"class","full_name":"Procodile::Process","name":"Process","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/process.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MUTEX","name":"MUTEX","value":"Mutex.new"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,name:String,command:String,options:Procodile::ProcessOption=ProcessOption.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","args_html":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","location":{"filename":"src/procodile/process.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L16"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, name, command, options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","doc":"\nReturn the first port that ports should be allocated from for this process\n","summary":"

Return the first port that ports should be allocated from for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":124,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L124"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@options.allocate_port_from"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"command","visibility":"Public","body":"@command"}},{"html_id":"command=(command:String)-instance-method","name":"command=","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"::String"}],"args_string":"(command : String)","args_html":"(command : String)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"command=","args":[{"name":"command","external_name":"command","restriction":"::String"}],"visibility":"Public","body":"@command = command"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"correct_quantity?(quantity)-instance-method","name":"correct_quantity?","doc":"\nIs the given quantity suitable for this process?\n","summary":"

Is the given quantity suitable for this process?

","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":""}],"args_string":"(quantity)","args_html":"(quantity)","location":{"filename":"src/procodile/process.cr","line_number":198,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L198"},"def":{"name":"correct_quantity?","args":[{"name":"quantity","external_name":"quantity","restriction":""}],"visibility":"Public","body":"if self.restart_mode == \"start-term\"\n quantity >= self.quantity\nelse\n self.quantity == quantity\nend"}},{"html_id":"create_instance(supervisor):Instance-instance-method","name":"create_instance","doc":"\nCreate a new instance\n","summary":"

Create a new instance

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor) : Instance","args_html":"(supervisor) : Instance","location":{"filename":"src/procodile/process.cr","line_number":166,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L166"},"def":{"name":"create_instance","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"return_type":"Instance","visibility":"Public","body":"Instance.new(supervisor, self, get_instance_id)"}},{"html_id":"default_log_file_name:String-instance-method","name":"default_log_file_name","doc":"\nReturn the defualt log file name\n","summary":"

Return the defualt log file name

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L86"},"def":{"name":"default_log_file_name","return_type":"String","visibility":"Public","body":"@options.log_file_name || \"#{@name}.log\""}},{"html_id":"default_log_path:String-instance-method","name":"default_log_path","doc":"\nReturn the log path for this process if no log path is provided and split logs\nis enabled\n","summary":"

Return the log path for this process if no log path is provided and split logs is enabled

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":94,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L94"},"def":{"name":"default_log_path","return_type":"String","visibility":"Public","body":"if (lr = @config.log_root)\n File.join(lr, default_log_file_name)\nelse\n File.join(@config.root, default_log_file_name)\nend"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn all environment variables for this process\n","summary":"

Return all environment variables for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L34"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"global_variables = @config.environment_variables\nprocess_vars = if (process = @config.process_options[@name]?)\n process.env || ({} of String => String)\nelse\n {} of String => String\nend\nprocess_local_vars = if (local_process = @config.local_process_options[@name]?)\n local_process.env || ({} of String => String)\nelse\n {} of String => String\nend\nglobal_variables.merge(process_vars.merge(process_local_vars))\n"}},{"html_id":"generate_instances(supervisor,quantity=self.quantity):Array(Procodile::Instance)-instance-method","name":"generate_instances","doc":"\nGenerate an array of new instances for this process (based on its quantity)\n","summary":"

Generate an array of new instances for this process (based on its quantity)

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"args_string":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","args_html":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","location":{"filename":"src/procodile/process.cr","line_number":159,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L159"},"def":{"name":"generate_instances","args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"Array.new(quantity) do\n create_instance(supervisor)\nend"}},{"html_id":"get_instance_id:Int32-instance-method","name":"get_instance_id","doc":"\nIncrease the instance index and return\n","summary":"

Increase the instance index and return

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L24"},"def":{"name":"get_instance_id","return_type":"Int32","visibility":"Public","body":"MUTEX.synchronize do\n if @instance_index == 10000\n @instance_index = 0\n end\n @instance_index = @instance_index + 1\nend"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"log_color","visibility":"Public","body":"@log_color"}},{"html_id":"log_color=(log_color:Int32)-instance-method","name":"log_color=","abstract":false,"args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"args_string":"(log_color : Int32)","args_html":"(log_color : Int32)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"log_color=","args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"visibility":"Public","body":"@log_color = log_color"}},{"html_id":"log_path:String-instance-method","name":"log_path","doc":"\nReturn the path where log output for this process should be written to. If\nnone, output will be written to the supervisor log.\n","summary":"

Return the path where log output for this process should be written to.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L77"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = @options.log_path\nlog_path ? File.expand_path(log_path, @config.root) : default_log_path\n"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","doc":"\nThe maximum number of times this process can be respawned in the given period\n","summary":"

The maximum number of times this process can be respawned in the given period

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":62,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L62"},"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@options.max_respawns || 5"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L13"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"network_protocol:String-instance-method","name":"network_protocol","doc":"\nReturn the network protocol for this process\n","summary":"

Return the network protocol for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L152"},"def":{"name":"network_protocol","return_type":"String","visibility":"Public","body":"@options.network_protocol || \"tcp\""}},{"html_id":"options:Procodile::ProcessOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::ProcessOption)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(options : Procodile::ProcessOption)","args_html":"(options : Procodile::ProcessOption)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"@options = options"}},{"html_id":"proxy?:Bool-instance-method","name":"proxy?","doc":"\nIs this process enabled for proxying?\n","summary":"

Is this process enabled for proxying?

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L131"},"def":{"name":"proxy?","return_type":"Bool","visibility":"Public","body":"!(!@options.proxy_port)"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L145"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_address || \"127.0.0.1\" : nil"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L138"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_port : nil"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","doc":"\nHow many instances of this process should be started\n","summary":"

How many instances of this process should be started

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L55"},"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@options.quantity || 1"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"removed","visibility":"Public","body":"@removed"}},{"html_id":"removed=(removed:Bool)-instance-method","name":"removed=","abstract":false,"args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"args_string":"(removed : Bool)","args_html":"(removed : Bool)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"removed=","args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"visibility":"Public","body":"@removed = removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","doc":"\nThe respawn window. One hour by default.\n","summary":"

The respawn window.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":69,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L69"},"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@options.respawn_window || 3600"}},{"html_id":"restart_mode:String|Signal-instance-method","name":"restart_mode","doc":"\nDefines how this process should be restarted\n\nstart-term = start new instances and send term to children\nusr1 = just send a usr1 signal to the current instance\nusr2 = just send a usr2 signal to the current instance\nterm-start = stop the old instances, when no longer running, start a new one\n","summary":"

Defines how this process should be restarted

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":117,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L117"},"def":{"name":"restart_mode","return_type":"String | Signal","visibility":"Public","body":"@options.restart_mode || \"term-start\""}},{"html_id":"term_signal:Signal-instance-method","name":"term_signal","doc":"\nReturn the signal to send to terminate the process\n","summary":"

Return the signal to send to terminate the process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L105"},"def":{"name":"term_signal","return_type":"Signal","visibility":"Public","body":"@options.term_signal || Signal::TERM"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn a hash\n","summary":"

Return a hash

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":179,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L179"},"def":{"name":"to_hash","visibility":"Public","body":"ControlClientProcessStatus.new(name: self.name, log_color: self.log_color, quantity: self.quantity, max_respawns: self.max_respawns, respawn_window: self.respawn_window, command: self.command, restart_mode: self.restart_mode, log_path: self.log_path, removed: self.removed ? true : false, proxy_port: proxy_port, proxy_address: proxy_address)"}}]},{"html_id":"procodile/Procodile/ProcessOption","path":"Procodile/ProcessOption.html","kind":"struct","full_name":"Procodile::ProcessOption","name":"ProcessOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L7"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L22"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@allocate_port_from"}},{"html_id":"allocate_port_from=(allocate_port_from:Int32|Nil)-instance-method","name":"allocate_port_from=","abstract":false,"args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"args_string":"(allocate_port_from : Int32 | Nil)","args_html":"(allocate_port_from : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from=","args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@allocate_port_from = allocate_port_from"}},{"html_id":"env:Hash(String,String)-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L20"},"def":{"name":"env","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String))-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"args_string":"(env : Hash(String, String))","args_html":"(env : Hash(String, String))","location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L20"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"visibility":"Public","body":"@env = env"}},{"html_id":"log_file_name:String|Nil-instance-method","name":"log_file_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name","return_type":"String | ::Nil","visibility":"Public","body":"@log_file_name"}},{"html_id":"log_file_name=(log_file_name:String|Nil)-instance-method","name":"log_file_name=","abstract":false,"args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"args_string":"(log_file_name : String | Nil)","args_html":"(log_file_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name=","args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_file_name = log_file_name"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"max_respawns:Int32|Nil-instance-method","name":"max_respawns","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns","return_type":"Int32 | ::Nil","visibility":"Public","body":"@max_respawns"}},{"html_id":"max_respawns=(max_respawns:Int32|Nil)-instance-method","name":"max_respawns=","abstract":false,"args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"args_string":"(max_respawns : Int32 | Nil)","args_html":"(max_respawns : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns=","args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@max_respawns = max_respawns"}},{"html_id":"merge(other:self|Nil)-instance-method","name":"merge","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"args_string":"(other : self | Nil)","args_html":"(other : self | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L25"},"def":{"name":"merge","args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"visibility":"Public","body":"new_process_option = self\nif other.quantity\n new_process_option.quantity = other.quantity\nend\nif other.restart_mode\n new_process_option.restart_mode = other.restart_mode\nend\nif other.max_respawns\n new_process_option.max_respawns = other.max_respawns\nend\nif other.respawn_window\n new_process_option.respawn_window = other.respawn_window\nend\nif other.log_path\n new_process_option.log_path = other.log_path\nend\nif other.log_file_name\n new_process_option.log_file_name = other.log_file_name\nend\nif other.term_signal\n new_process_option.term_signal = other.term_signal\nend\nif other.allocate_port_from\n new_process_option.allocate_port_from = other.allocate_port_from\nend\nif other.proxy_port\n new_process_option.proxy_port = other.proxy_port\nend\nif other.proxy_address\n new_process_option.proxy_address = other.proxy_address\nend\nif other.network_protocol\n new_process_option.network_protocol = other.network_protocol\nend\nif other.env\n new_process_option.env = new_process_option.env.merge(other.env)\nend\nnew_process_option\n"}},{"html_id":"network_protocol:String|Nil-instance-method","name":"network_protocol","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol","return_type":"String | ::Nil","visibility":"Public","body":"@network_protocol"}},{"html_id":"network_protocol=(network_protocol:String|Nil)-instance-method","name":"network_protocol=","abstract":false,"args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"args_string":"(network_protocol : String | Nil)","args_html":"(network_protocol : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol=","args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"visibility":"Public","body":"@network_protocol = network_protocol"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_address=(proxy_address:String|Nil)-instance-method","name":"proxy_address=","abstract":false,"args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(proxy_address : String | Nil)","args_html":"(proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address=","args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"@proxy_address = proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"proxy_port=(proxy_port:Int32|Nil)-instance-method","name":"proxy_port=","abstract":false,"args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"args_string":"(proxy_port : Int32 | Nil)","args_html":"(proxy_port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port=","args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@proxy_port = proxy_port"}},{"html_id":"quantity:Int32|Nil-instance-method","name":"quantity","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity","return_type":"Int32 | ::Nil","visibility":"Public","body":"@quantity"}},{"html_id":"quantity=(quantity:Int32|Nil)-instance-method","name":"quantity=","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"args_string":"(quantity : Int32 | Nil)","args_html":"(quantity : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity=","args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@quantity = quantity"}},{"html_id":"respawn_window:Int32|Nil-instance-method","name":"respawn_window","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window","return_type":"Int32 | ::Nil","visibility":"Public","body":"@respawn_window"}},{"html_id":"respawn_window=(respawn_window:Int32|Nil)-instance-method","name":"respawn_window=","abstract":false,"args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"args_string":"(respawn_window : Int32 | Nil)","args_html":"(respawn_window : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window=","args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@respawn_window = respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}},{"html_id":"restart_mode=(restart_mode:Signal|String|Nil)-instance-method","name":"restart_mode=","abstract":false,"args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"args_string":"(restart_mode : Signal | String | Nil)","args_html":"(restart_mode : Signal | String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode=","args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"visibility":"Public","body":"@restart_mode = restart_mode"}},{"html_id":"term_signal:Signal|Nil-instance-method","name":"term_signal","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal","return_type":"Signal | ::Nil","visibility":"Public","body":"@term_signal"}},{"html_id":"term_signal=(term_signal:Signal|Nil)-instance-method","name":"term_signal=","abstract":false,"args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"args_string":"(term_signal : Signal | Nil)","args_html":"(term_signal : Signal | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal=","args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"visibility":"Public","body":"@term_signal = term_signal"}}]},{"html_id":"procodile/Procodile/ProcfileOption","path":"Procodile/ProcfileOption.html","kind":"struct","full_name":"Procodile::ProcfileOption","name":"ProcfileOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L45"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":46,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L46"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":60,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L60"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String|Nil-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name","return_type":"String | ::Nil","visibility":"Public","body":"@app_name"}},{"html_id":"app_name=(app_name:String|Nil)-instance-method","name":"app_name=","abstract":false,"args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"args_string":"(app_name : String | Nil)","args_html":"(app_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name=","args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@app_name = app_name"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"@console_command"}},{"html_id":"console_command=(console_command:String|Nil)-instance-method","name":"console_command=","abstract":false,"args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"args_string":"(console_command : String | Nil)","args_html":"(console_command : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command=","args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"visibility":"Public","body":"@console_command = console_command"}},{"html_id":"env:Hash(String,String)|Nil-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L57"},"def":{"name":"env","return_type":"Hash(String, String) | ::Nil","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String)|Nil)-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"args_string":"(env : Hash(String, String) | Nil)","args_html":"(env : Hash(String, String) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L57"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"visibility":"Public","body":"@env = env"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"@exec_prefix"}},{"html_id":"exec_prefix=(exec_prefix:String|Nil)-instance-method","name":"exec_prefix=","abstract":false,"args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"args_string":"(exec_prefix : String | Nil)","args_html":"(exec_prefix : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix=","args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"visibility":"Public","body":"@exec_prefix = exec_prefix"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"log_root=(log_root:String|Nil)-instance-method","name":"log_root=","abstract":false,"args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(log_root : String | Nil)","args_html":"(log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root=","args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_root = log_root"}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"@pid_root"}},{"html_id":"pid_root=(pid_root:String|Nil)-instance-method","name":"pid_root=","abstract":false,"args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"args_string":"(pid_root : String | Nil)","args_html":"(pid_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root=","args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@pid_root = pid_root"}},{"html_id":"processes:Hash(String,ProcessOption)|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes","return_type":"Hash(String, ProcessOption) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:Hash(String,ProcessOption)|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"args_string":"(processes : Hash(String, ProcessOption) | Nil)","args_html":"(processes : Hash(String, ProcessOption) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"procfile:String|Nil-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile","return_type":"String | ::Nil","visibility":"Public","body":"@procfile"}},{"html_id":"procfile=(procfile:String|Nil)-instance-method","name":"procfile=","abstract":false,"args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(procfile : String | Nil)","args_html":"(procfile : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile=","args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"@procfile = procfile"}},{"html_id":"root:String|Nil-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L49"},"def":{"name":"root","return_type":"String | ::Nil","visibility":"Public","body":"@root"}},{"html_id":"root=(root:String|Nil)-instance-method","name":"root=","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"args_string":"(root : String | Nil)","args_html":"(root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L49"},"def":{"name":"root=","args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@root = root"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L54"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"@user"}},{"html_id":"user=(user:String|Nil)-instance-method","name":"user=","abstract":false,"args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"args_string":"(user : String | Nil)","args_html":"(user : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L54"},"def":{"name":"user=","args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"visibility":"Public","body":"@user = user"}}]},{"html_id":"procodile/Procodile/RunOptions","path":"Procodile/RunOptions.html","kind":"struct","full_name":"Procodile::RunOptions","name":"RunOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"force_single_log:Bool|Nil-instance-method","name":"force_single_log","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log","return_type":"Bool | ::Nil","visibility":"Public","body":"@force_single_log"}},{"html_id":"force_single_log=(force_single_log:Bool|Nil)-instance-method","name":"force_single_log=","abstract":false,"args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"args_string":"(force_single_log : Bool | Nil)","args_html":"(force_single_log : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log=","args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@force_single_log = force_single_log"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}}]},{"html_id":"procodile/Procodile/SignalHandler","path":"Procodile/SignalHandler.html","kind":"class","full_name":"Procodile::SignalHandler","name":"SignalHandler","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/signal_handler.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"QUEUE","name":"QUEUE","value":"[] of Signal"},{"id":"SIGNALS","name":"SIGNALS","value":"{Signal::TERM, Signal::USR1, Signal::USR2, Signal::INT, Signal::HUP}"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L14"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"handle-instance-method","name":"handle","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L45"},"def":{"name":"handle","visibility":"Public","body":"if (signal = QUEUE.shift?)\n Procodile.log(nil, \"system\", \"Supervisor received #{signal} signal\")\n @handlers[signal].try(&.each(&.call))\nend"}},{"html_id":"notice-instance-method","name":"notice","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":41,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L41"},"def":{"name":"notice","visibility":"Public","body":"@pipe[:writer].write(\".\".to_slice)"}},{"html_id":"pipe:Hash(Symbol,IO::FileDescriptor)-instance-method","name":"pipe","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L12"},"def":{"name":"pipe","return_type":"Hash(Symbol, IO::FileDescriptor)","visibility":"Public","body":"@pipe"}},{"html_id":"register(signal:Signal,&block)-instance-method","name":"register","abstract":false,"args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"args_string":"(signal : Signal, &block)","args_html":"(signal : Signal, &block)","location":{"filename":"src/procodile/signal_handler.cr","line_number":36,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L36"},"def":{"name":"register","args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"__temp_54 = signal\n@handlers[__temp_54]? || (@handlers[__temp_54] = [] of Proc(Nil))\n@handlers[signal] << block\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L27"},"def":{"name":"start","visibility":"Public","body":"spawn do\n loop do\n handle\n sleep(1)\n end\nend"}}]},{"html_id":"procodile/Procodile/StatusCLIOutput","path":"Procodile/StatusCLIOutput.html","kind":"class","full_name":"Procodile::StatusCLIOutput","name":"StatusCLIOutput","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/status_cli_output.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(status:Procodile::ControlClientReplyForStatusCommand)-class-method","name":"new","abstract":false,"args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"args_string":"(status : Procodile::ControlClientReplyForStatusCommand)","args_html":"(status : Procodile::ControlClientReplyForStatusCommand)","location":{"filename":"src/procodile/status_cli_output.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L5"},"def":{"name":"new","args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"visibility":"Public","body":"_ = allocate\n_.initialize(status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"print_all-instance-method","name":"print_all","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L8"},"def":{"name":"print_all","visibility":"Public","body":"print_header\nprint_processes\n"}},{"html_id":"print_header-instance-method","name":"print_header","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L13"},"def":{"name":"print_header","visibility":"Public","body":"puts(\"Procodile Version #{@status.version.to_s.color(34)}\")\nputs(\"Application Root #{(@status.root).to_s.color(34)}\")\nputs(\"Supervisor PID #{(@status.supervisor[\"pid\"]).to_s.color(34)}\")\nif (time = @status.supervisor[\"started_at\"])\n time = Time.unix(time)\n puts(\"Started #{time.to_s.color(34)}\")\nend\nif !@status.environment_variables.empty?\n @status.environment_variables.each_with_index do |__arg0, index|\n key = __arg0[0]\n value = __arg0[1]\n if index == 0\n print(\"Environment Vars \")\n else\n print(\" \")\n end\n print(key.color(34))\n puts(\" #{value}\")\n end\nend\nif @status.messages.empty?\nelse\n puts\n @status.messages.each do |message|\n puts(\"\\e[31m * #{Message.parse(message)}\\e[0m\")\n end\nend\n"}},{"html_id":"print_processes-instance-method","name":"print_processes","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":40,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L40"},"def":{"name":"print_processes","visibility":"Public","body":"puts\n@status.processes.each_with_index do |process, index|\n if index == 0\n else\n puts\n end\n puts((\"|| \".color(process.log_color)) + (process.name.color(process.log_color)))\n puts(\"#{\"||\".color(process.log_color)} Quantity #{process.quantity}\")\n puts(\"#{\"||\".color(process.log_color)} Command #{process.command}\")\n puts(\"#{\"||\".color(process.log_color)} Respawning #{process.max_respawns} every #{process.respawn_window} seconds\")\n puts(\"#{\"||\".color(process.log_color)} Restart mode #{process.restart_mode}\")\n puts(\"#{\"||\".color(process.log_color)} Log path #{process.log_path || \"none specified\"}\")\n puts(\"#{\"||\".color(process.log_color)} Address/Port #{process.proxy_port ? \"#{process.proxy_address}:#{process.proxy_port}\" : \"none\"}\")\n instances = @status.instances[process.name]\n if instances.empty?\n puts(\"#{\"||\".color(process.log_color)} No processes running.\")\n else\n instances.each do |instance|\n print((\"|| => \".color(process.log_color)) + ((instance.description.to_s.ljust(17, ' ')).color(process.log_color)))\n print(instance.status.ljust(10, ' '))\n print(\" #{(formatted_timestamp(instance.started_at)).ljust(10, ' ')}\")\n print(\" pid:#{instance.pid.to_s.ljust(6, ' ')}\")\n print(\" respawns:#{instance.respawns.to_s.ljust(4, ' ')}\")\n print(\" port:#{(instance.port || '-').to_s.ljust(6, ' ')}\")\n print(\" tag:#{instance.tag || '-'}\")\n puts\n end\n end\nend\n"}}]},{"html_id":"procodile/Procodile/Supervisor","path":"Procodile/Supervisor.html","kind":"class","full_name":"Procodile::Supervisor","name":"Supervisor","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/supervisor.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L9"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,run_options:Procodile::RunOptions=Procodile::RunOptions.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"args_string":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","args_html":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L15"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, run_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_instance(instance,io=nil)-instance-method","name":"add_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"args_string":"(instance, io = nil)","args_html":"(instance, io = nil)","location":{"filename":"src/procodile/supervisor.cr","line_number":234,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L234"},"def":{"name":"add_instance","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"visibility":"Public","body":"if io\n add_reader(instance, io)\nend\n__temp_44 = instance.process\n@processes[__temp_44]? || (@processes[__temp_44] = [] of Procodile::Instance)\nif @processes[instance.process].includes?(instance)\nelse\n @processes[instance.process] << instance\nend\n"}},{"html_id":"add_reader(instance,io)-instance-method","name":"add_reader","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"args_string":"(instance, io)","args_html":"(instance, io)","location":{"filename":"src/procodile/supervisor.cr","line_number":229,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L229"},"def":{"name":"add_reader","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"visibility":"Public","body":"@readers[io] = instance\n@signal_handler.notice\n"}},{"html_id":"allow_respawning?:Bool-instance-method","name":"allow_respawning?","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L27"},"def":{"name":"allow_respawning?","return_type":"Bool","visibility":"Public","body":"@run_options.respawn != false"}},{"html_id":"check_concurrency(options={}ofString=>String):Hash(Symbol,Array(Procodile::Instance))-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","args_html":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","location":{"filename":"src/procodile/supervisor.cr","line_number":175,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L175"},"def":{"name":"check_concurrency","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"return_type":"Hash(Symbol, Array(Procodile::Instance))","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Checking process concurrency\")\nif options.reload == false\nelse\n reload_config\nend\nresult = check_instance_quantities\nif result[:started].empty? && result[:stopped].empty?\n Procodile.log(nil, \"system\", \"Process concurrency looks good\")\nelse\n if result[:started].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check started #{result[:started].map(&.description).join(\", \")}\")\n end\n if result[:stopped].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check stopped #{result[:stopped].map(&.description).join(\", \")}\")\n end\nend\nresult\n"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":203,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L203"},"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"messages = [] of SupervisorMessages\nprocesses.each do |process, process_instances|\n if process.correct_quantity?(process_instances.size)\n else\n messages << SupervisorMessages.new(type: \"incorrect_quantity\", process: process.name, current: process_instances.size, desired: process.quantity)\n end\n process_instances.each do |instance|\n if instance.should_be_running? && (instance.status != \"Running\")\n messages << SupervisorMessages.new(type: \"not_running\", instance: instance.description, status: instance.status)\n end\n end\nend\nmessages\n"}},{"html_id":"processes:Hash(Procodile::Process,Array(Procodile::Instance))-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"processes","visibility":"Public","body":"@processes"}},{"html_id":"reload_config-instance-method","name":"reload_config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L170"},"def":{"name":"reload_config","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Reloading configuration\")\n@config.reload\n"}},{"html_id":"remove_instance(instance)-instance-method","name":"remove_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""}],"args_string":"(instance)","args_html":"(instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":242,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L242"},"def":{"name":"remove_instance","args":[{"name":"instance","external_name":"instance","restriction":""}],"visibility":"Public","body":"if @processes[instance.process]\n @processes[instance.process].delete(instance)\n @readers.delete(instance)\nend"}},{"html_id":"restart(options=SupervisorOptions.new)-instance-method","name":"restart","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new)","args_html":"(options = SupervisorOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L110"},"def":{"name":"restart","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_restarted = [] of Array(Procodile::Instance | ::Nil)\nprocesses = options.processes\nif processes.nil?\n Procodile.log(nil, \"system\", \"Restarting all #{@config.app_name} processes\")\n instances = @processes.values.flatten\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Restarting #{instances.size} process(es)\")\nend\nstopped = (check_instance_quantities(:stopped, processes))[:stopped].map do |i|\n [i, nil]\nend\ninstances_restarted.concat(stopped)\ninstances.each do |instance|\n if instance.stopping?\n next\n end\n new_instance = instance.restart\n instances_restarted << [instance, new_instance]\nend\nchecked = (check_instance_quantities(:started, processes))[:started].map do |i|\n [nil, i]\nend\ninstances_restarted.concat(checked)\ninstances_restarted\n"}},{"html_id":"run_options:Procodile::RunOptions-instance-method","name":"run_options","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"run_options","visibility":"Public","body":"@run_options"}},{"html_id":"start(after_start:Proc(Procodile::Supervisor,Nil))-instance-method","name":"start","abstract":false,"args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"args_string":"(after_start : Proc(Procodile::Supervisor, Nil))","args_html":"(after_start : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/supervisor.cr","line_number":31,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L31"},"def":{"name":"start","args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"visibility":"Public","body":"begin\n Procodile.log(nil, \"system\", \"Procodile supervisor started with PID #{::Process.pid}\")\n Procodile.log(nil, \"system\", \"Application root is #{@config.root}\")\n if @run_options.respawn == false\n Procodile.log(nil, \"system\", \"Automatic respawning is disabled\")\n end\n ControlServer.start(self)\n if @run_options.proxy\n Procodile.log(nil, \"system\", \"Proxy is enabled\")\n @tcp_proxy = TCPProxy.start(self)\n end\n watch_for_output\n @started_at = Time.local\n after_start.call(self)\nrescue e\n Procodile.log(nil, \"system\", \"Error: #{e.class} (#{e.message})\")\n e.backtrace.each do |bt|\n Procodile.log(nil, \"system\", \"=> #{bt})\")\n end\n stop(SupervisorOptions.new(stop_supervisor: true))\nensure\n loop do\n supervise\n sleep(3)\n end\nend"}},{"html_id":"start_processes(process_names:Array(String)|Nil,options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"start_processes","abstract":false,"args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":61,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L61"},"def":{"name":"start_processes","args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_started = [] of Procodile::Instance\n@config.processes.each do |name, process|\n if process_names && (!(process_names.includes?(name.to_s)))\n next\n end\n if @processes[process]? && (!@processes[process].empty?)\n next\n end\n instances = process.generate_instances(self)\n instances.each(&.start)\n instances_started.concat(instances)\nend\ninstances_started\n"}},{"html_id":"started_at:Time?-instance-method","name":"started_at","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"started_at","visibility":"Public","body":"@started_at"}},{"html_id":"stop(options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"stop","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L80"},"def":{"name":"stop","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"if options.stop_supervisor\n @run_options.stop_when_none = true\nend\nreload_config\nprocesses = options.processes\ninstances_stopped = [] of Procodile::Instance\nif processes.nil?\n Procodile.log(nil, \"system\", \"Stopping all #{@config.app_name} processes\")\n @processes.each do |_, instances|\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\n end\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Stopping #{instances.size} process(es)\")\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\nend\ninstances_stopped\n"}},{"html_id":"stop_supervisor-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L145"},"def":{"name":"stop_supervisor","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Stopping Procodile supervisor\")\nFileUtils.rm_rf(File.join(@config.pid_root, \"procodile.pid\"))\n::Process.exit(0)\n"}},{"html_id":"supervise-instance-method","name":"supervise","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":151,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L151"},"def":{"name":"supervise","visibility":"Public","body":"remove_stopped_instances\nremove_removed_processes\n@processes.each do |_, instances|\n instances.each(&.check)\nend\nif @run_options.stop_when_none && @processes.all? do |_, instances|\n instances.reject(&.failed?).empty?\nend\n Procodile.log(nil, \"system\", \"All processes have stopped\")\n stop_supervisor\nend\n"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tcp_proxy:Procodile::TCPProxy?-instance-method","name":"tcp_proxy","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"tcp_proxy","visibility":"Public","body":"@tcp_proxy"}},{"html_id":"to_hash-instance-method","name":"to_hash","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":196,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L196"},"def":{"name":"to_hash","visibility":"Public","body":"{started_at: @started_at.not_nil!.to_unix, pid: ::Process.pid}"}}]},{"html_id":"procodile/Procodile/SupervisorMessages","path":"Procodile/SupervisorMessages.html","kind":"struct","full_name":"Procodile::SupervisorMessages","name":"SupervisorMessages","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(type:String,process:String|Nil=nil,current:Int32|Nil=nil,desired:Int32|Nil=nil,instance:String|Nil=nil,status:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"args_string":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","args_html":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"new","args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(type, process, current, desired, instance, status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":147,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L147"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@type.clone, @process.clone, @current.clone, @desired.clone, @instance.clone, @status.clone)"}},{"html_id":"copy_with(type_type=@type,process_process=@process,current_current=@current,desired_desired=@desired,instance_instance=@instance,status_status=@status)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"args_string":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","args_html":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"copy_with","args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"visibility":"Public","body":"self.class.new(_type, _process, _current, _desired, _instance, _status)"}},{"html_id":"current:Int32|Nil-instance-method","name":"current","abstract":false,"def":{"name":"current","return_type":"Int32 | ::Nil","visibility":"Public","body":"@current"}},{"html_id":"desired:Int32|Nil-instance-method","name":"desired","abstract":false,"def":{"name":"desired","return_type":"Int32 | ::Nil","visibility":"Public","body":"@desired"}},{"html_id":"instance:String|Nil-instance-method","name":"instance","abstract":false,"def":{"name":"instance","return_type":"String | ::Nil","visibility":"Public","body":"@instance"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"status:String|Nil-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String | ::Nil","visibility":"Public","body":"@status"}},{"html_id":"type:String-instance-method","name":"type","abstract":false,"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"procodile/Procodile/SupervisorOptions","path":"Procodile/SupervisorOptions.html","kind":"struct","full_name":"Procodile::SupervisorOptions","name":"SupervisorOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=nil,stop_supervisor:Bool|Nil=nil,tag:String|Nil=nil,reload:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"new","args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, stop_supervisor, tag, reload)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @stop_supervisor.clone, @tag.clone, @reload.clone)"}},{"html_id":"copy_with(processes_processes=@processes,stop_supervisor_stop_supervisor=@stop_supervisor,tag_tag=@tag,reload_reload=@reload)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"args_string":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","args_html":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _stop_supervisor, _tag, _reload)"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/TCPProxy","path":"Procodile/TCPProxy.html","kind":"class","full_name":"Procodile::TCPProxy","name":"TCPProxy","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/tcp_proxy.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L3"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"proxy = new(supervisor)\nproxy.start\nproxy\n"}}],"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"args_string":"(supervisor : Procodile::Supervisor)","args_html":"(supervisor : Procodile::Supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L9"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_process(process)-instance-method","name":"add_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L23"},"def":{"name":"add_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"begin\n if process.proxy?\n @listeners[TCPServer.new(process.proxy_address.not_nil!, process.proxy_port.not_nil!)] = process\n Procodile.log(nil, \"proxy\", \"Proxying traffic on #{process.proxy_address}:#{process.proxy_port} to #{process.name}\".color(32))\n @sp_writer.write(\".\".to_slice)\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nend"}},{"html_id":"handle_client(client,server)-instance-method","name":"handle_client","abstract":false,"args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"args_string":"(client, server)","args_html":"(client, server)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L86"},"def":{"name":"handle_client","args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"visibility":"Public","body":"begin\n process = @listeners[server]\n instances = @supervisor.processes[process]? || ([] of Procodile::Instance)\n if instances.empty?\n Procodile.log(nil, \"proxy\", \"There are no processes running for #{process.name}\")\n else\n instance = instances[rand(instances.size)]\n backend_socket = begin\n TCPSocket.new(\"127.0.0.1\", instance.port)\n rescue\n nil\n end\n if backend_socket.nil?\n Procodile.log(nil, \"proxy\", \"Could not connect to #{instance.description}:#{instance.port}\")\n return\n end\n readers = {:backend => backend_socket, :client => client}\n sleep_chan = Channel(Nil).new\n readers_chan = Channel(Nil).new\n spawn do\n loop do\n sleep(0.5)\n sleep_chan.send(nil)\n end\n end\n readers.values.each do |socket|\n spawn do\n loop do\n key = readers.key_for(socket)\n opposite_side = key == (:client) ? :backend : :client\n if socket.read_byte\n readers.delete(opposite_side)\n else\n begin\n readers[opposite_side].write(Bytes.new(socket.read(Bytes.new(1024))))\n rescue\n nil\n end\n end\n readers_chan.send(nil)\n end\n end\n end\n loop do\n select\nwhen readers_chan.receive\nwhen sleep_chan.receive\nend\n\n end\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nensure\n if backend_socket\n backend_socket.close\n end\n if client\n client.close\n end\nend"}},{"html_id":"listen-instance-method","name":"listen","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":39,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L39"},"def":{"name":"listen","visibility":"Public","body":"sleep_chan = Channel(Nil).new\nsp_reader_chan = Channel(Nil).new\nlistener_chan = Channel(Nil).new\nspawn do\n loop do\n sleep(30)\n sleep_chan.send(nil)\n end\nend\nspawn do\n loop do\n @sp_reader.read(Bytes.new(999))\n sp_reader_chan.send(nil)\n end\nend\n@listeners.keys.each do |io|\n spawn do\n loop do\n handle_client(client: io.accept, server: io)\n listener_chan.send(nil)\n end\n end\nend\nloop do\n select\nwhen sp_reader_chan.receive\nwhen listener_chan.receive\nwhen sleep_chan.receive\nend\n\n @stopped_processes.reject do |process|\n if ( io = @listeners.key_for(process))\n Procodile.log(nil, \"proxy\", \"Stopped proxy listener for #{process.name}\")\n io.close\n @listeners.delete(io)\n end\n true\n end\nend\n"}},{"html_id":"remove_process(process)-instance-method","name":"remove_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L34"},"def":{"name":"remove_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"@stopped_processes << process\n@sp_writer.write(\".\".to_slice)\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L15"},"def":{"name":"start","visibility":"Public","body":"@supervisor.config.processes.each do |_, p|\n add_process(p)\nend\nspawn do\n listen\n Procodile.log(nil, \"proxy\", \"Stopped listening on all ports\")\nend\n"}}]}]},{"html_id":"procodile/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/color.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/color.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nString might end up being conformed of bytes which are an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but\ninvalid byte sequences, when asked as chars, will use the unicode replacement\nchar (value 0xFFFD). For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","instance_methods":[{"html_id":"color(color)-instance-method","name":"color","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""}],"args_string":"(color)","args_html":"(color)","location":{"filename":"src/procodile/color.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/color.cr#L2"},"def":{"name":"color","args":[{"name":"color","external_name":"color","restriction":""}],"visibility":"Public","body":"\"\\e[#{color}m#{self}\\e[0m\""}}]}]}} \ No newline at end of file diff --git a/search-index.js b/search-index.js index 720df8d..c933d5a 100644 --- a/search-index.js +++ b/search-index.js @@ -1 +1 @@ -crystal_doc_search_index_callback({"repository_name":"procodile","body":"# Procodile 🐊\n\nRunning & deploying Ruby apps to places like [Viaduct](https://viaduct.io) & Heroku is really easy but running processes on actual servers is less fun. Procodile aims to take some the stress out of running your Ruby/Rails apps and give you some of the useful process management features you get from the takes of the PaaS providers.\n\nProcodile is a bit like [Foreman](https://github.com/ddollar/foreman) but things are designed to run in the background (as well as the foreground if you prefer) and there's a supervisor which keeps an eye on your processes and will respawn them if they die.\n\nProcodile works out of the box with your existing `Procfile`.\n\n* [Watch a quick screencast](https://vimeo.com/188041935)\n* [Read documentation](https://github.com/adamcooke/procodile/wiki)\n* [View on RubyGems](https://rubygems.org/gems/procodile)\n* [Check the CHANGELOG](https://github.com/adamcooke/procodile/blob/master/CHANGELOG.md)\n\n![Screenshot](https://share.adam.ac/16/cAZRKUM7.png)\n","program":{"html_id":"procodile/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"procodile","program":true,"enum":false,"alias":false,"const":false,"constants":[{"id":"ORIGINAL_ARGV","name":"ORIGINAL_ARGV","value":"ARGV.join(\" \")"}],"types":[{"html_id":"procodile/Procodile","path":"Procodile.html","kind":"module","full_name":"Procodile","name":"Procodile","abstract":false,"locations":[{"filename":"src/procodile.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L6"},{"filename":"src/procodile/app_determination.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L3"},{"filename":"src/procodile/cli.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L6"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L1"},{"filename":"src/procodile/commands/console_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L1"},{"filename":"src/procodile/commands/exec_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L1"},{"filename":"src/procodile/commands/help_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L1"},{"filename":"src/procodile/commands/kill_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L1"},{"filename":"src/procodile/commands/log_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L1"},{"filename":"src/procodile/commands/reload_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L1"},{"filename":"src/procodile/commands/restart_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L1"},{"filename":"src/procodile/commands/run_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L1"},{"filename":"src/procodile/commands/start_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L1"},{"filename":"src/procodile/commands/status_command.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L4"},{"filename":"src/procodile/commands/stop_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L1"},{"filename":"src/procodile/config.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L3"},{"filename":"src/procodile/control_client.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L4"},{"filename":"src/procodile/control_server.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L4"},{"filename":"src/procodile/control_session.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L4"},{"filename":"src/procodile/error.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/error.cr#L1"},{"filename":"src/procodile/instance.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L3"},{"filename":"src/procodile/logger.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L3"},{"filename":"src/procodile/message.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L1"},{"filename":"src/procodile/process.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L3"},{"filename":"src/procodile/procfile_option.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L5"},{"filename":"src/procodile/signal_handler.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L1"},{"filename":"src/procodile/status_cli_output.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L3"},{"filename":"src/procodile/supervisor.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L8"},{"filename":"src/procodile/tcp_proxy.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L1"},{"filename":"src/procodile/version.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/version.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/procodile_cr/procodile_cr/src/procodile\\\"`).chomp.stringify }}"}],"class_methods":[{"html_id":"bin_path-class-method","name":"bin_path","abstract":false,"location":{"filename":"src/procodile.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L11"},"def":{"name":"bin_path","visibility":"Public","body":"File.join(root, \"bin\", \"procodile\")"}},{"html_id":"log(color,name,text)-class-method","name":"log","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"args_string":"(color, name, text)","args_html":"(color, name, text)","location":{"filename":"src/procodile/logger.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L8"},"def":{"name":"log","args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"visibility":"Public","body":"mutex.synchronize do\n text.to_s.lines.map(&.chomp).each do |message|\n output = \"\"\n output = output + (\"#{Time.local.to_s(\"%H:%M:%S\")} #{name.ljust(18, ' ')} | \".color(color))\n output = output + message\n STDOUT.puts(output)\n STDOUT.flush\n end\nend"}},{"html_id":"mutex:Mutex-class-method","name":"mutex","abstract":false,"location":{"filename":"src/procodile/logger.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/logger.cr#L4"},"def":{"name":"mutex","return_type":"Mutex","visibility":"Public","body":"@@mutex || (@@mutex = Mutex.new)"}},{"html_id":"root-class-method","name":"root","abstract":false,"location":{"filename":"src/procodile.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile.cr#L7"},"def":{"name":"root","visibility":"Public","body":"File.expand_path(\"..\", \"/home/runner/work/procodile_cr/procodile_cr/src\")"}}],"types":[{"html_id":"procodile/Procodile/AppDetermination","path":"Procodile/AppDetermination.html","kind":"class","full_name":"Procodile::AppDetermination","name":"AppDetermination","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/app_determination.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L7"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"doc":"\nThis class is responsible for determining which application should be used\n","summary":"

This class is responsible for determining which application should be used

","constructors":[{"html_id":"new(pwd:String,given_root:String|Nil,given_procfile:String|Nil,global_options=nil)-class-method","name":"new","doc":"Start by creating an determination ased on the root and procfile that has been provided\nto us by the user (from --root and/or --procfile)","summary":"

Start by creating an determination ased on the root and procfile that has been provided to us by the user (from --root and/or --procfile)

","abstract":false,"args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"args_string":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","args_html":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","location":{"filename":"src/procodile/app_determination.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L19"},"def":{"name":"new","args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(pwd, given_root, given_procfile, global_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"procfile:String?-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L15"},"def":{"name":"procfile","visibility":"Public","body":"@procfile"}},{"html_id":"root:String?-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/app_determination.cr#L15"},"def":{"name":"root","visibility":"Public","body":"@root"}}]},{"html_id":"procodile/Procodile/CLI","path":"Procodile/CLI.html","kind":"class","full_name":"Procodile::CLI","name":"CLI","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/cli.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L7"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L2"},{"filename":"src/procodile/commands/console_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L2"},{"filename":"src/procodile/commands/exec_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L2"},{"filename":"src/procodile/commands/help_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L2"},{"filename":"src/procodile/commands/kill_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L2"},{"filename":"src/procodile/commands/log_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L2"},{"filename":"src/procodile/commands/reload_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L2"},{"filename":"src/procodile/commands/restart_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L2"},{"filename":"src/procodile/commands/run_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L2"},{"filename":"src/procodile/commands/start_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L2"},{"filename":"src/procodile/commands/status_command.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L5"},{"filename":"src/procodile/commands/stop_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COMMANDS","name":"COMMANDS","value":"[{:help, \"Shows this help output\"}, {:kill, \"Forcefully kill all known processes\"}, {:start, \"Starts processes and/or the supervisor\"}, {:stop, \"Stops processes and/or the supervisor\"}, {:exec, \"Execute a command within the environment\"}, {:run, \"Execute a command within the environment\"}, {:reload, \"Reload Procodile configuration\"}, {:check_concurrency, \"Check process concurrency\"}, {:log, \"Open/stream a Procodile log file\"}, {:restart, \"Restart processes\"}, {:status, \"Show the current status of processes\"}, {:console, \"Open a console within the environment\"}]"}],"included_modules":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"commands:Hash(String,CliCommand)-class-method","name":"commands","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L24"},"def":{"name":"commands","return_type":"Hash(String, CliCommand)","visibility":"Public","body":"@@commands || (@@commands = {} of String => CliCommand)"}},{"html_id":"options(name,&block:Proc(OptionParser,Procodile::CLI,Nil))-class-method","name":"options","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","args_html":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":30,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L30"},"def":{"name":"options","args":[{"name":"name","external_name":"name","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(OptionParser, Procodile::CLI, Nil)"},"visibility":"Public","body":"@@options[name] = block"}},{"html_id":"start_supervisor(config:Procodile::Config,options=Procodile::CliOptions.new,&block:Proc(Procodile::Supervisor,Nil))-class-method","name":"start_supervisor","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"args_string":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","args_html":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L66"},"def":{"name":"start_supervisor","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(Procodile::Supervisor, Nil)"},"visibility":"Public","body":"run_options = Procodile::RunOptions.new\nrun_options.respawn = options.respawn\nrun_options.stop_when_none = options.stop_when_none\nrun_options.proxy = options.proxy\nrun_options.force_single_log = options.foreground\nrun_options.port_allocations = options.port_allocations\ntidy_pids(config)\nif options.clean\n FileUtils.rm_rf(Dir[File.join(config.pid_root, \"*\")])\n puts(\"Emptied PID directory\")\nend\nif !Dir[File.join(config.pid_root, \"*\")].empty?\n raise(Error.new(\"The PID directory (#{config.pid_root}) is not empty. Cannot start unless things are clean.\"))\nend\nFile.write(\"/proc/self/comm\", \"[procodile] #{config.app_name} (#{config.root})\")\nif options.foreground\n File.write(config.supervisor_pid_path, ::Process.pid)\n (Supervisor.new(config, run_options)).start(block)\nelse\n FileUtils.rm_rf(File.join(config.pid_root, \"*.pid\"))\n process = ::Process.fork do\n log_path = File.open(config.log_path, \"a\")\n STDOUT.reopen(log_path)\n STDOUT.sync = true\n STDERR.reopen(log_path)\n STDERR.sync = true\n (Supervisor.new(config, run_options)).start(block)\n end\n spawn do\n process.wait\n end\n pid = process.pid\n File.write(config.supervisor_pid_path, pid)\n puts(\"Started Procodile supervisor with PID #{pid}\")\nend\n"}},{"html_id":"tidy_pids(config:Procodile::Config)-class-method","name":"tidy_pids","doc":"Clean up procodile.pid and procodile.sock with all unused pid files","summary":"

Clean up procodile.pid and procodile.sock with all unused pid files

","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":116,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L116"},"def":{"name":"tidy_pids","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"visibility":"Public","body":"FileUtils.rm_rf(config.supervisor_pid_path)\nFileUtils.rm_rf(config.sock_path)\npid_files = Dir[File.join(config.pid_root, \"*.pid\")]\npid_files.each do |pid_path|\n file_name = (pid_path.split(\"/\")).last\n pid = (File.read(pid_path)).to_i\n if ::Process.exists?(pid)\n puts(\"Could not remove #{file_name} because process (#{pid}) was active\")\n else\n FileUtils.rm_rf(pid_path)\n puts(\"Removed #{file_name} because process was not active\")\n end\nend\n"}}],"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L34"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"config=(config:Procodile::Config)-instance-method","name":"config=","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"config=","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"visibility":"Public","body":"@config = config"}},{"html_id":"dispatch(command)-instance-method","name":"dispatch","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command)","args_html":"(command)","location":{"filename":"src/procodile/cli.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L58"},"def":{"name":"dispatch","args":[{"name":"command","external_name":"command","restriction":""}],"visibility":"Public","body":"if self.class.commands.has_key?(command)\n self.class.commands[command].callable.call\nelse\n raise(Error.new(\"Invalid command '#{command}'\"))\nend"}},{"html_id":"options:Procodile::CliOptions-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::CliOptions)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"args_string":"(options : Procodile::CliOptions)","args_html":"(options : Procodile::CliOptions)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/cli.cr#L22"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"visibility":"Public","body":"@options = options"}}],"types":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","path":"Procodile/CLI/CheckConcurrencyCommand.html","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"check_concurrency-instance-method","name":"check_concurrency","abstract":false,"location":{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/check_concurrency_command.cr#L12"},"def":{"name":"check_concurrency","visibility":"Public","body":"if supervisor_running?\n reply = (ControlClient.run(@config.sock_path, \"check_concurrency\", reload: @options.reload)).as(NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)))\n if reply[\"started\"].empty? && reply[\"stopped\"].empty?\n puts(\"Processes are running as configured\")\n else\n reply[\"started\"].each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n reply[\"stopped\"].each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","path":"Procodile/CLI/ConsoleCommand.html","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/console_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"console-instance-method","name":"console","abstract":false,"location":{"filename":"src/procodile/commands/console_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/console_command.cr#L9"},"def":{"name":"console","visibility":"Public","body":"if (cmd = @config.console_command)\n exec(cmd)\nelse\n raise(Error.new(\"No console command has been configured in the Procfile\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ExecCommand","path":"Procodile/CLI/ExecCommand.html","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/exec_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"exec(command=nil)-instance-method","name":"exec","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/exec_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/exec_command.cr#L9"},"def":{"name":"exec","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"desired_command = command || (ARGV[1..].join(\" \"))\nif (prefix = @config.exec_prefix)\n desired_command = \"#{prefix} #{desired_command}\"\nend\nif desired_command.empty?\n raise(Error.new(\"You need to specify a command to run (e.g. procodile run -- rake db:migrate)\"))\nelse\n environment = @config.environment_variables\n if ENV[\"PROCODILE_EXEC_QUIET\"]?.try(&.to_i) == 1\n else\n puts(\"Running with #{desired_command.color(33)}\")\n environment.each do |key, value|\n puts(\" #{key.color(34)} #{value}\")\n end\n end\n begin\n Dir.cd(@config.root)\n ::Process.exec(desired_command, env: environment, shell: true)\n rescue e : RuntimeError\n raise(Error.new(e.message))\n end\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/HelpCommand","path":"Procodile/CLI/HelpCommand.html","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/help_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"help-instance-method","name":"help","abstract":false,"location":{"filename":"src/procodile/commands/help_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/help_command.cr#L9"},"def":{"name":"help","visibility":"Public","body":"puts(\"\\e[45;37mWelcome to Procodile v#{Procodile::VERSION}\\e[0m\")\nputs(\"For documentation see https://adam.ac/procodile.\")\nputs\nputs(\"The following commands are supported:\")\nputs\nself.class.commands.to_a.sort_by do |x|\n x[0]\nend.to_h.each do |method, options|\n if options.description\n puts(\" \\e[34m#{method.to_s.ljust(18, ' ')}\\e[0m #{options.description}\")\n end\nend\nputs\nputs(\"For details for the options available for each command, use the --help option.\")\nputs(\"For example 'procodile start --help'.\")\n"}}]},{"html_id":"procodile/Procodile/CLI/KillCommand","path":"Procodile/CLI/KillCommand.html","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/kill_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"kill-instance-method","name":"kill","abstract":false,"location":{"filename":"src/procodile/commands/kill_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/kill_command.cr#L9"},"def":{"name":"kill","visibility":"Public","body":"Dir[File.join(@config.pid_root, \"*.pid\")].each do |pid_path|\n name = (pid_path.split('/')).last.rstrip(\".pid\")\n pid = (File.read(pid_path)).to_i\n begin\n ::Process.signal(Signal::INT, pid)\n puts(\"Sent KILL to #{pid} (#{name})\")\n rescue RuntimeError\n end\n FileUtils.rm(pid_path)\nend"}}]},{"html_id":"procodile/Procodile/CLI/LogCommand","path":"Procodile/CLI/LogCommand.html","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/log_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"log-instance-method","name":"log","abstract":false,"location":{"filename":"src/procodile/commands/log_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/log_command.cr#L20"},"def":{"name":"log","visibility":"Public","body":"opts = [] of String\nif options.wait\n opts << \"-f\"\nend\nif options.lines\n opts << \"-n #{options.lines}\"\nend\nprocess = options.process\nif process\n if ( process = @config.processes[process])\n log_path = process.log_path\n else\n raise(Error.new(\"Invalid process name '#{process}'\"))\n end\nelse\n log_path = @config.log_path\nend\nif File.exists?(log_path)\n ::Process.exec(\"tail #{opts.join(' ')} #{log_path}\", shell: true)\nelse\n raise(Error.new(\"No file found at #{log_path}\"))\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/ReloadCommand","path":"Procodile/CLI/ReloadCommand.html","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/reload_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/commands/reload_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/reload_command.cr#L9"},"def":{"name":"reload","visibility":"Public","body":"if supervisor_running?\n ControlClient.run(@config.sock_path, \"reload_config\")\n puts(\"Reloaded Procodile config\")\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RestartCommand","path":"Procodile/CLI/RestartCommand.html","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/restart_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"restart-instance-method","name":"restart","abstract":false,"location":{"filename":"src/procodile/commands/restart_command.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/restart_command.cr#L16"},"def":{"name":"restart","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"restart\", processes: process_names_from_cli_option, tag: @options.tag)).as(Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)))\n if instances.empty?\n puts(\"There are no processes to restart.\")\n else\n instances.each do |old_instance, new_instance|\n if old_instance && new_instance\n if old_instance.description == new_instance.description\n puts((\"Restarted\".color(35)) + \" #{old_instance.description}\")\n else\n puts((\"Restarted\".color(35)) + \" #{old_instance.description} -> #{new_instance.description}\")\n end\n else\n if old_instance\n puts((\"Stopped\".color(31)) + \" #{old_instance.description}\")\n else\n if new_instance\n puts((\"Started\".color(32)) + \" #{new_instance.description}\")\n end\n end\n end\n STDOUT.flush\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RunCommand","path":"Procodile/CLI/RunCommand.html","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/run_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"run(command=nil)-instance-method","name":"run","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/run_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/run_command.cr#L9"},"def":{"name":"run","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"exec(command)"}}]},{"html_id":"procodile/Procodile/CLI/StartCommand","path":"Procodile/CLI/StartCommand.html","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/start_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/commands/start_command.cr","line_number":59,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/start_command.cr#L59"},"def":{"name":"start","visibility":"Public","body":"if supervisor_running?\n if @options.foreground\n raise(Error.new(\"Cannot be started in the foreground because supervisor already running\"))\n end\n if @options.respawn\n raise(Error.new(\"Cannot disable respawning because supervisor is already running\"))\n end\n if @options.stop_when_none\n raise(Error.new(\"Cannot stop supervisor when none running because supervisor is already running\"))\n end\n if @options.proxy\n raise(Error.new(\"Cannot enable the proxy when the supervisor is running\"))\n end\n instances = (ControlClient.run(@config.sock_path, \"start_processes\", processes: process_names_from_cli_option, tag: @options.tag, port_allocations: @options.port_allocations)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes to start.\")\n else\n instances.each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n if @options.start_supervisor == false\n raise(Error.new(\"Supervisor is not running and cannot be started because --no-supervisor is set\"))\n else\n self.class.start_supervisor(@config, @options) do |supervisor|\n if @options.start_processes == false\n else\n supervisor.start_processes(process_names_from_cli_option, SupervisorOptions.new(tag: @options.tag))\n end\n end\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StatusCommand","path":"Procodile/CLI/StatusCommand.html","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/status_command.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"status-instance-method","name":"status","abstract":false,"location":{"filename":"src/procodile/commands/status_command.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/status_command.cr#L23"},"def":{"name":"status","visibility":"Public","body":"if supervisor_running?\n status = (ControlClient.run(@config.sock_path, \"status\")).as(ControlClientReplyForStatusCommand)\n if @options.json\n puts(status.to_json)\n else\n if @options.json_pretty\n puts(status)\n nil\n else\n if @options.simple\n if status.messages.empty?\n message = status.instances.map do |p, i|\n \"#{p}[#{i.size}]\"\n end\n puts(\"OK || #{message.join(\", \")}\")\n else\n message = status.messages.map do |p|\n Message.parse(p)\n end.join(\", \")\n puts(\"Issues || #{message}\")\n end\n else\n (StatusCLIOutput.new(status)).print_all\n end\n end\n end\nelse\n if @options.simple\n puts(\"NotRunning || Procodile supervisor isn't running\")\n else\n raise(Error.new(\"Procodile supervisor isn't running\"))\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StopCommand","path":"Procodile/CLI/StopCommand.html","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/stop_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"stop-instance-method","name":"stop","abstract":false,"location":{"filename":"src/procodile/commands/stop_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/commands/stop_command.cr#L20"},"def":{"name":"stop","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"stop\", processes: process_names_from_cli_option, stop_supervisor: @options.stop_supervisor)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes were stopped.\")\n else\n instances.each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\n if @options.stop_supervisor\n puts(\"Supervisor will be stopped when processes are stopped.\")\n end\n if @options.wait_until_supervisor_stopped\n puts(\"Waiting for supervisor to stop...\")\n loop do\n sleep(1)\n if supervisor_running?\n sleep(1)\n else\n puts(\"Supervisor has stopped\")\n exit(0)\n end\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]}]},{"html_id":"procodile/Procodile/CliCommand","path":"Procodile/CliCommand.html","kind":"struct","full_name":"Procodile::CliCommand","name":"CliCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,description:String|Nil,options:Proc(OptionParser,Procodile::CLI,Nil)|Nil,callable:Proc(Nil))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"args_string":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","args_html":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, description, options, callable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"callable:Proc(Nil)-instance-method","name":"callable","abstract":false,"def":{"name":"callable","return_type":"Proc(Nil)","visibility":"Public","body":"@callable"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @description.clone, @options.clone, @callable.clone)"}},{"html_id":"copy_with(name_name=@name,description_description=@description,options_options=@options,callable_callable=@callable)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"args_string":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","args_html":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L64"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _description, _options, _callable)"}},{"html_id":"description:String|Nil-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String | ::Nil","visibility":"Public","body":"@description"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"options:Proc(OptionParser,Procodile::CLI,Nil)|Nil-instance-method","name":"options","abstract":false,"def":{"name":"options","return_type":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil","visibility":"Public","body":"@options"}}]},{"html_id":"procodile/Procodile/CliOptions","path":"Procodile/CliOptions.html","kind":"struct","full_name":"Procodile::CliOptions","name":"CliOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":70,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L70"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":92,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L92"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clean:Bool|Nil-instance-method","name":"clean","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean","return_type":"Bool | ::Nil","visibility":"Public","body":"@clean"}},{"html_id":"clean=(clean:Bool|Nil)-instance-method","name":"clean=","abstract":false,"args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"args_string":"(clean : Bool | Nil)","args_html":"(clean : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean=","args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@clean = clean"}},{"html_id":"development:Bool|Nil-instance-method","name":"development","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L87"},"def":{"name":"development","return_type":"Bool | ::Nil","visibility":"Public","body":"@development"}},{"html_id":"development=(development:Bool|Nil)-instance-method","name":"development=","abstract":false,"args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"args_string":"(development : Bool | Nil)","args_html":"(development : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L87"},"def":{"name":"development=","args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@development = development"}},{"html_id":"foreground:Bool|Nil-instance-method","name":"foreground","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground","return_type":"Bool | ::Nil","visibility":"Public","body":"@foreground"}},{"html_id":"foreground=(foreground:Bool|Nil)-instance-method","name":"foreground=","abstract":false,"args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"args_string":"(foreground : Bool | Nil)","args_html":"(foreground : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground=","args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@foreground = foreground"}},{"html_id":"json:Bool|Nil-instance-method","name":"json","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L82"},"def":{"name":"json","return_type":"Bool | ::Nil","visibility":"Public","body":"@json"}},{"html_id":"json=(json:Bool|Nil)-instance-method","name":"json=","abstract":false,"args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"args_string":"(json : Bool | Nil)","args_html":"(json : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L82"},"def":{"name":"json=","args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json = json"}},{"html_id":"json_pretty:Bool|Nil-instance-method","name":"json_pretty","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty","return_type":"Bool | ::Nil","visibility":"Public","body":"@json_pretty"}},{"html_id":"json_pretty=(json_pretty:Bool|Nil)-instance-method","name":"json_pretty=","abstract":false,"args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"args_string":"(json_pretty : Bool | Nil)","args_html":"(json_pretty : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty=","args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json_pretty = json_pretty"}},{"html_id":"lines:Int32|Nil-instance-method","name":"lines","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines","return_type":"Int32 | ::Nil","visibility":"Public","body":"@lines"}},{"html_id":"lines=(lines:Int32|Nil)-instance-method","name":"lines=","abstract":false,"args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"args_string":"(lines : Int32 | Nil)","args_html":"(lines : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines=","args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@lines = lines"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L90"},"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"process=(process:String|Nil)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"args_string":"(process : String | Nil)","args_html":"(process : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L90"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"visibility":"Public","body":"@process = process"}},{"html_id":"processes:String|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes","return_type":"String | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:String|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"args_string":"(processes : String | Nil)","args_html":"(processes : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"reload=(reload:Bool|Nil)-instance-method","name":"reload=","abstract":false,"args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(reload : Bool | Nil)","args_html":"(reload : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload=","args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@reload = reload"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"simple:Bool|Nil-instance-method","name":"simple","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple","return_type":"Bool | ::Nil","visibility":"Public","body":"@simple"}},{"html_id":"simple=(simple:Bool|Nil)-instance-method","name":"simple=","abstract":false,"args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"args_string":"(simple : Bool | Nil)","args_html":"(simple : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple=","args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@simple = simple"}},{"html_id":"start_processes:Bool|Nil-instance-method","name":"start_processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_processes"}},{"html_id":"start_processes=(start_processes:Bool|Nil)-instance-method","name":"start_processes=","abstract":false,"args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"args_string":"(start_processes : Bool | Nil)","args_html":"(start_processes : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes=","args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_processes = start_processes"}},{"html_id":"start_supervisor:Bool|Nil-instance-method","name":"start_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_supervisor"}},{"html_id":"start_supervisor=(start_supervisor:Bool|Nil)-instance-method","name":"start_supervisor=","abstract":false,"args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(start_supervisor : Bool | Nil)","args_html":"(start_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor=","args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_supervisor = start_supervisor"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"stop_supervisor=(stop_supervisor:Bool|Nil)-instance-method","name":"stop_supervisor=","abstract":false,"args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(stop_supervisor : Bool | Nil)","args_html":"(stop_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor=","args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_supervisor = stop_supervisor"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}},{"html_id":"tag=(tag:String|Nil)-instance-method","name":"tag=","abstract":false,"args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"args_string":"(tag : String | Nil)","args_html":"(tag : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag=","args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"visibility":"Public","body":"@tag = tag"}},{"html_id":"wait:Bool|Nil-instance-method","name":"wait","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait"}},{"html_id":"wait=(wait:Bool|Nil)-instance-method","name":"wait=","abstract":false,"args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"args_string":"(wait : Bool | Nil)","args_html":"(wait : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait=","args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait = wait"}},{"html_id":"wait_until_supervisor_stopped:Bool|Nil-instance-method","name":"wait_until_supervisor_stopped","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait_until_supervisor_stopped"}},{"html_id":"wait_until_supervisor_stopped=(wait_until_supervisor_stopped:Bool|Nil)-instance-method","name":"wait_until_supervisor_stopped=","abstract":false,"args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"args_string":"(wait_until_supervisor_stopped : Bool | Nil)","args_html":"(wait_until_supervisor_stopped : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped=","args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait_until_supervisor_stopped = wait_until_supervisor_stopped"}}]},{"html_id":"procodile/Procodile/Config","path":"Procodile/Config.html","kind":"class","full_name":"Procodile::Config","name":"Config","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/config.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COLORS","name":"COLORS","value":"[35, 31, 36, 32, 33, 34]","doc":"35 紫,31 红,36 青,32 绿,33 橘,34 蓝","summary":"

35 紫,31 红,36 青,32 绿,33 橘,34 蓝

"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(root:String,procfile:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(root : String, procfile : String | Nil = nil)","args_html":"(root : String, procfile : String | Nil = nil)","location":{"filename":"src/procodile/config.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L20"},"def":{"name":"new","args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(root, procfile)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":95,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L95"},"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name || (@app_name = (local_options.app_name || options.app_name) || \"Procodile\")"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":99,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L99"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"local_options.console_command || options.console_command"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L138"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"option_env = options.env || ({} of String => String)\nlocal_option_env = local_options.env || ({} of String => String)\noption_env.merge(local_option_env)\n"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":103,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L103"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"local_options.exec_prefix || options.exec_prefix"}},{"html_id":"loaded_at:Time?-instance-method","name":"loaded_at","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L18"},"def":{"name":"loaded_at","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options:ProcfileOption-instance-method","name":"local_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":119,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L119"},"def":{"name":"local_options","return_type":"ProcfileOption","visibility":"Public","body":"@local_options || (@local_options = load_local_options_from_file)"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":182,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L182"},"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.local\""}},{"html_id":"local_process_options:Hash(String,ProcessOption)-instance-method","name":"local_process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":127,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L127"},"def":{"name":"local_process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@local_process_options || (@local_process_options = local_options.processes || ({} of String => ProcessOption))"}},{"html_id":"log_path:String-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L152"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = local_options.log_path || options.log_path\nif log_path\n File.expand_path(log_path, self.root)\nelse\n if log_path.nil? && self.log_root\n File.join(self.log_root.not_nil!, \"procodile.log\")\n else\n File.expand_path(\"procodile.log\", self.root)\n end\nend\n"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":164,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L164"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"log_root = local_options.log_root || options.log_root\nif log_root\n File.expand_path(log_root, self.root)\nend\n"}},{"html_id":"options:ProcfileOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":115,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L115"},"def":{"name":"options","return_type":"ProcfileOption","visibility":"Public","body":"@options || (@options = load_options_from_file)"}},{"html_id":"options_for_process(name):ProcessOption-instance-method","name":"options_for_process","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name) : ProcessOption","args_html":"(name) : ProcessOption","location":{"filename":"src/procodile/config.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L131"},"def":{"name":"options_for_process","args":[{"name":"name","external_name":"name","restriction":""}],"return_type":"ProcessOption","visibility":"Public","body":"po = process_options[name]? || ProcessOption.new\nlocal_po = local_process_options[name]? || ProcessOption.new\npo.merge(local_po)\n"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":178,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L178"},"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.options\""}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":144,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L144"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"File.expand_path((local_options.pid_root || options.pid_root) || \"pids\", self.root)"}},{"html_id":"process_list:Hash(String,String)-instance-method","name":"process_list","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":111,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L111"},"def":{"name":"process_list","return_type":"Hash(String, String)","visibility":"Public","body":"@process_list || (@process_list = load_process_list_from_file)"}},{"html_id":"process_options:Hash(String,ProcessOption)-instance-method","name":"process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":123,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L123"},"def":{"name":"process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@process_options || (@process_options = options.processes || ({} of String => ProcessOption))"}},{"html_id":"processes:Hash(String,Procodile::Process)-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L107"},"def":{"name":"processes","return_type":"Hash(String, Procodile::Process)","visibility":"Public","body":"@processes || (@processes = {} of String => Procodile::Process)"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":174,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L174"},"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path || (File.join(self.root, \"Procfile\"))"}},{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":47,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L47"},"def":{"name":"reload","visibility":"Public","body":"@process_list = nil\n@options = nil\n@local_options = nil\n@process_options = nil\n@local_process_options = nil\n@loaded_at = nil\n@environment_variables = nil\nif (processes = @processes)\n process_list.each do |name, command|\n if ( process = processes[name]?)\n process.removed = false\n if process.command != command\n process.command = command\n Procodile.log(nil, \"system\", \"#{name} command has changed. Updated.\")\n end\n process.options = options_for_process(name)\n else\n Procodile.log(nil, \"system\", \"#{name} has been added to the Procfile.\")\n processes[name] = create_process(name, command, COLORS[(processes.size.divmod(COLORS.size))[1]])\n end\n end\n removed_processes = processes.keys - process_list.keys\n removed_processes.each do |process_name|\n if ( p = (processes[process_name]))\n p.removed = true\n processes.delete(process_name)\n Procodile.log(nil, \"system\", \"#{process_name} has been removed in the Procfile. It will be removed when it is stopped.\")\n end\n end\nend\n@loaded_at = Time.local\n"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L18"},"def":{"name":"root","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L170"},"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.sock\")"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":148,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L148"},"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.pid\")"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":91,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/config.cr#L91"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"local_options.user || options.user"}}]},{"html_id":"procodile/Procodile/ControlClient","path":"Procodile/ControlClient.html","kind":"class","full_name":"Procodile::ControlClient","name":"ControlClient","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_client.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"run(sock_path:String,command:String,**options)-class-method","name":"run","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"args_string":"(sock_path : String, command : String, **options)","args_html":"(sock_path : String, command : String, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L18"},"def":{"name":"run","args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"begin\n socket = self.new(sock_path)\n socket.run(command, **options)\nensure\n socket.try(&.disconnect)\nend"}}],"constructors":[{"html_id":"new(sock_path,block:Proc(ControlClient,Nil)|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"args_string":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","args_html":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","location":{"filename":"src/procodile/control_client.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L6"},"def":{"name":"new","args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(sock_path, block)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"disconnect-instance-method","name":"disconnect","abstract":false,"location":{"filename":"src/procodile/control_client.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L53"},"def":{"name":"disconnect","visibility":"Public","body":"@socket.try(&.close)"}},{"html_id":"run(command,**options)-instance-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command, **options)","args_html":"(command, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_client.cr#L25"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"@socket.puts(\"#{command} #{options.to_json}\")\nif (data = @socket.gets)\n code, reply = data.strip.split(/\\s+/, 2)\n if code.to_i == 200\n if reply && (!reply.empty?)\n case command\n when \"start_processes\", \"stop\"\n Array(InstanceConfig).from_json(reply)\n when \"restart\"\n Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)).from_json(reply)\n when \"check_concurrency\"\n NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)).from_json(reply)\n when \"status\"\n ControlClientReplyForStatusCommand.from_json(reply)\n end\n else\n true\n end\n else\n raise(Error.new(\"Error from control server: #{code} (#{reply.inspect})\"))\n end\nelse\n raise(Error.new(\"Control server disconnected.\"))\nend\n"}}]},{"html_id":"procodile/Procodile/ControlClientProcessStatus","path":"Procodile/ControlClientProcessStatus.html","kind":"struct","full_name":"Procodile::ControlClientProcessStatus","name":"ControlClientProcessStatus","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,log_color:Int32,quantity:Int32,max_respawns:Int32,respawn_window:Int32,command:String,restart_mode:Signal|String|Nil,log_path:String|Nil,removed:Bool,proxy_port:Int32|Nil,proxy_address:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","args_html":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, log_color, quantity, max_respawns, respawn_window, command, restart_mode, log_path, removed, proxy_port, proxy_address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":137,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L137"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @log_color.clone, @quantity.clone, @max_respawns.clone, @respawn_window.clone, @command.clone, @restart_mode.clone, @log_path.clone, @removed.clone, @proxy_port.clone, @proxy_address.clone)"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"def":{"name":"command","return_type":"String","visibility":"Public","body":"@command"}},{"html_id":"copy_with(name_name=@name,log_color_log_color=@log_color,quantity_quantity=@quantity,max_respawns_max_respawns=@max_respawns,respawn_window_respawn_window=@respawn_window,command_command=@command,restart_mode_restart_mode=@restart_mode,log_path_log_path=@log_path,removed_removed=@removed,proxy_port_proxy_port=@proxy_port,proxy_address_proxy_address=@proxy_address)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"args_string":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","args_html":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L125"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _log_color, _quantity, _max_respawns, _respawn_window, _command, _restart_mode, _log_path, _removed, _proxy_port, _proxy_address)"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"def":{"name":"log_color","return_type":"Int32","visibility":"Public","body":"@log_color"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","abstract":false,"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@max_respawns"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","abstract":false,"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@quantity"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"def":{"name":"removed","return_type":"Bool","visibility":"Public","body":"@removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","abstract":false,"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}}]},{"html_id":"procodile/Procodile/ControlClientReplyForStatusCommand","path":"Procodile/ControlClientReplyForStatusCommand.html","kind":"struct","full_name":"Procodile::ControlClientReplyForStatusCommand","name":"ControlClientReplyForStatusCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(version:String,messages:Array(SupervisorMessages),root:String,app_name:String,supervisor:NamedTuple(started_at:Int64,pid:Int64),instances:Hash(String,Array(InstanceConfig)),processes:Array(ControlClientProcessStatus),environment_variables:Hash(String,String),procfile_path:String,options_path:String,local_options_path:String,sock_path:String,supervisor_pid_path:String,pid_root:String,loaded_at:Int64,log_root:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","args_html":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"new","args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(version, messages, root, app_name, supervisor, instances, processes, environment_variables, procfile_path, options_path, local_options_path, sock_path, supervisor_pid_path, pid_root, loaded_at, log_root)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":167,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L167"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@version.clone, @messages.clone, @root.clone, @app_name.clone, @supervisor.clone, @instances.clone, @processes.clone, @environment_variables.clone, @procfile_path.clone, @options_path.clone, @local_options_path.clone, @sock_path.clone, @supervisor_pid_path.clone, @pid_root.clone, @loaded_at.clone, @log_root.clone)"}},{"html_id":"copy_with(version_version=@version,messages_messages=@messages,root_root=@root,app_name_app_name=@app_name,supervisor_supervisor=@supervisor,instances_instances=@instances,processes_processes=@processes,environment_variables_environment_variables=@environment_variables,procfile_path_procfile_path=@procfile_path,options_path_options_path=@options_path,local_options_path_local_options_path=@local_options_path,sock_path_sock_path=@sock_path,supervisor_pid_path_supervisor_pid_path=@supervisor_pid_path,pid_root_pid_root=@pid_root,loaded_at_loaded_at=@loaded_at,log_root_log_root=@log_root)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"args_string":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","args_html":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L150"},"def":{"name":"copy_with","args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"visibility":"Public","body":"self.class.new(_version, _messages, _root, _app_name, _supervisor, _instances, _processes, _environment_variables, _procfile_path, _options_path, _local_options_path, _sock_path, _supervisor_pid_path, _pid_root, _loaded_at, _log_root)"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"@environment_variables"}},{"html_id":"instances:Hash(String,Array(InstanceConfig))-instance-method","name":"instances","abstract":false,"def":{"name":"instances","return_type":"Hash(String, Array(InstanceConfig))","visibility":"Public","body":"@instances"}},{"html_id":"loaded_at:Int64-instance-method","name":"loaded_at","abstract":false,"def":{"name":"loaded_at","return_type":"Int64","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"@local_options_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"@messages"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"@options_path"}},{"html_id":"pid_root:String-instance-method","name":"pid_root","abstract":false,"def":{"name":"pid_root","return_type":"String","visibility":"Public","body":"@pid_root"}},{"html_id":"processes:Array(ControlClientProcessStatus)-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(ControlClientProcessStatus)","visibility":"Public","body":"@processes"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"def":{"name":"root","return_type":"String","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"@sock_path"}},{"html_id":"supervisor:NamedTuple(started_at:Int64,pid:Int64)-instance-method","name":"supervisor","abstract":false,"def":{"name":"supervisor","return_type":"NamedTuple(started_at: Int64, pid: Int64)","visibility":"Public","body":"@supervisor"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"@supervisor_pid_path"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"procodile/Procodile/ControlServer","path":"Procodile/ControlServer.html","kind":"class","full_name":"Procodile::ControlServer","name":"ControlServer","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_server.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/control_server.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_server.cr#L6"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"begin\n sock_path = supervisor.config.sock_path\n spawn do\n server = UNIXServer.new(sock_path)\n Procodile.log(nil, \"control\", \"Listening at #{sock_path}\")\n loop do\n client = server.accept\n session = ControlSession.new(supervisor, client)\n while ( line = client.gets)\n if ( response = session.receive_data(line.strip))\n client.puts(response)\n end\n end\n client.close\n end\n end\nensure\n FileUtils.rm_rf(sock_path.not_nil!)\nend"}}]},{"html_id":"procodile/Procodile/ControlSession","path":"Procodile/ControlSession.html","kind":"class","full_name":"Procodile::ControlSession","name":"ControlSession","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_session.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,client:UNIXSocket)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"args_string":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","args_html":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","location":{"filename":"src/procodile/control_session.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L6"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, client)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"check_concurrency(options):String-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L55"},"def":{"name":"check_concurrency","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"result = @supervisor.check_concurrency(SupervisorOptions.new(reload: options.reload))\nresult = result.transform_values do |instances|\n instances.map(&.to_hash)\nend\n\"200 #{result.to_json}\"\n"}},{"html_id":"receive_data(data)-instance-method","name":"receive_data","abstract":false,"args":[{"name":"data","external_name":"data","restriction":""}],"args_string":"(data)","args_html":"(data)","location":{"filename":"src/procodile/control_session.cr","line_number":100,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L100"},"def":{"name":"receive_data","args":[{"name":"data","external_name":"data","restriction":""}],"visibility":"Public","body":"command, _options = data.split(/\\s+/, 2)\noptions = ControlSessionData.from_json(_options)\ncallable = {} of String => Proc(ControlSessionData, String)\ncallable[\"start_processes\"] = ->start_processes(ControlSessionData)\ncallable[\"stop\"] = ->stop(ControlSessionData)\ncallable[\"restart\"] = ->restart(ControlSessionData)\ncallable[\"reload_config\"] = ->reload_config(ControlSessionData)\ncallable[\"check_concurrency\"] = ->check_concurrency(ControlSessionData)\ncallable[\"status\"] = ->status(ControlSessionData)\nif callable[command]?\n begin\n callable[command].call(options)\n rescue e : Procodile::Error\n Procodile.log(nil, \"control\", \"Error: #{e.message}\".color(31))\n \"500 #{e.message}\"\n end\nelse\n \"404 Invaid command\"\nend\n"}},{"html_id":"reload_config(options):String-instance-method","name":"reload_config","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L49"},"def":{"name":"reload_config","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"@supervisor.reload_config\n\"200 []\"\n"}},{"html_id":"restart(options):String-instance-method","name":"restart","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":38,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L38"},"def":{"name":"restart","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.restart(SupervisorOptions.new(processes: options.processes, tag: options.tag))\n\"200 \" + instances.map do |a|\n a.map do |i|\n i ? i.to_hash : nil\n end\nend.to_json\n"}},{"html_id":"start_processes(options):String-instance-method","name":"start_processes","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L9"},"def":{"name":"start_processes","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"if options.port_allocations\n run_options_port_allocations = @supervisor.run_options.port_allocations\n if run_options_port_allocations\n run_options_port_allocations.merge!(options.port_allocations.not_nil!)\n else\n @supervisor.run_options.port_allocations = options.port_allocations\n end\nend\ninstances = @supervisor.start_processes(options.processes, SupervisorOptions.new(tag: options.tag))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}},{"html_id":"status(options):String-instance-method","name":"status","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L66"},"def":{"name":"status","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = {} of String => Array(Procodile::InstanceConfig)\n@supervisor.processes.each do |process, process_instances|\n instances[process.name] = [] of Procodile::InstanceConfig\n process_instances.each do |instance|\n instances[process.name] << instance.to_hash\n end\nend\nprocesses = @supervisor.processes.keys.map(&.to_hash)\nresult = ControlClientReplyForStatusCommand.new(version: Procodile::VERSION, messages: @supervisor.messages, root: @supervisor.config.root, app_name: @supervisor.config.app_name, supervisor: @supervisor.to_hash, instances: instances, processes: processes, environment_variables: @supervisor.config.environment_variables, procfile_path: @supervisor.config.procfile_path, options_path: @supervisor.config.options_path, local_options_path: @supervisor.config.local_options_path, sock_path: @supervisor.config.sock_path, log_root: @supervisor.config.log_root, supervisor_pid_path: @supervisor.config.supervisor_pid_path, pid_root: @supervisor.config.pid_root, loaded_at: @supervisor.config.loaded_at.not_nil!.to_unix)\n\"200 #{result.to_json}\"\n"}},{"html_id":"stop(options):String-instance-method","name":"stop","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/control_session.cr#L27"},"def":{"name":"stop","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.stop(SupervisorOptions.new(processes: options.processes, stop_supervisor: options.stop_supervisor))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}}]},{"html_id":"procodile/Procodile/ControlSessionData","path":"Procodile/ControlSessionData.html","kind":"struct","full_name":"Procodile::ControlSessionData","name":"ControlSessionData","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=[]ofString,tag:String|Nil=nil,port_allocations:Hash(String,Int32)|Nil=nil,reload:Bool|Nil=nil,stop_supervisor:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"new","args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, tag, port_allocations, reload, stop_supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":102,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L102"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @tag.clone, @port_allocations.clone, @reload.clone, @stop_supervisor.clone)"}},{"html_id":"copy_with(processes_processes=@processes,tag_tag=@tag,port_allocations_port_allocations=@port_allocations,reload_reload=@reload,stop_supervisor_stop_supervisor=@stop_supervisor)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"args_string":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","args_html":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L96"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _tag, _port_allocations, _reload, _stop_supervisor)"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Error","path":"Procodile/Error.html","kind":"class","full_name":"Procodile::Error","name":"Error","abstract":false,"superclass":{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/error.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/error.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"}},{"html_id":"procodile/Procodile/Instance","path":"Procodile/Instance.html","kind":"class","full_name":"Procodile::Instance","name":"Instance","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/instance.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,process:Procodile::Process,id:Int32)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"args_string":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","args_html":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","location":{"filename":"src/procodile/instance.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L17"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, process, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_respawn:Int32-instance-method","name":"add_respawn","doc":"\nIncrement the counter of respawns for this process\n","summary":"

Increment the counter of respawns for this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":356,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L356"},"def":{"name":"add_respawn","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif last_respawn && last_respawn < (Time.local - @process.respawn_window.seconds)\n @respawns = 1\nelse\n @last_respawn = Time.local\n @respawns = @respawns + 1\nend\n"}},{"html_id":"allocate_port(max_attempts=10)-instance-method","name":"allocate_port","doc":"\nFind a port number for this instance to listen on. We just check that nothing is already listening on it.\nThe process is expected to take it straight away if it wants it.\n","summary":"

Find a port number for this instance to listen on.

","abstract":false,"args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"args_string":"(max_attempts = 10)","args_html":"(max_attempts = 10)","location":{"filename":"src/procodile/instance.cr","line_number":389,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L389"},"def":{"name":"allocate_port","args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"visibility":"Public","body":"attempts = 0\nwhile !@port\n attempts = attempts + 1\n possible_port = rand(20000..29999)\n if self.port_available?(possible_port)\n Procodile.log(@process.log_color, description, \"Allocated port as #{possible_port}\")\n @port = possible_port\n else\n if attempts >= max_attempts\n raise(Procodile::Error.new(\"Couldn't allocate port for #{process.name}\"))\n end\n end\nend\n"}},{"html_id":"can_respawn?:Bool-instance-method","name":"can_respawn?","doc":"\nCan this process be respawned if needed?\n","summary":"

Can this process be respawned if needed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":336,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L336"},"def":{"name":"can_respawn?","return_type":"Bool","visibility":"Public","body":"(!stopping?) && (respawns + 1) <= @process.max_respawns"}},{"html_id":"check(options={}ofString=>String)-instance-method","name":"check","doc":"\nCheck the status of this process and handle as appropriate.\n","summary":"

Check the status of this process and handle as appropriate.

","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String)","args_html":"(options = {} of String => String)","location":{"filename":"src/procodile/instance.cr","line_number":303,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L303"},"def":{"name":"check","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"visibility":"Public","body":"if failed?\n return\nend\nif self.running?\n true\nelse\n if update_pid\n return check\n end\n if @supervisor.allow_respawning?\n if can_respawn?\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning...\")\n start\n add_respawn\n else\n if respawns >= @process.max_respawns\n Procodile.log(@process.log_color, description, \"\\e[41;37mWarning:\\e[0m\\e[31m this process has been respawned #{respawns} times and keeps dying.\\e[0m\")\n Procodile.log(@process.log_color, description, \"It will not be respawned automatically any longer and will no longer be managed.\".color(31))\n @failed = Time.local\n tidy\n end\n end\n else\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning not available.\")\n @failed = Time.local\n tidy\n end\nend\n"}},{"html_id":"description-instance-method","name":"description","doc":"\nReturn a description for this instance\n","summary":"

Return a description for this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":26,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L26"},"def":{"name":"description","visibility":"Public","body":"\"#{@process.name}.#{@id}\""}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn an array of environment variables that should be set\n","summary":"

Return an array of environment variables that should be set

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L57"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"vars = @process.environment_variables.merge({\"PROC_NAME\" => self.description, \"PID_FILE\" => self.pid_file_path, \"APP_ROOT\" => @process.config.root})\nif @port\n vars[\"PORT\"] = @port.to_s\nend\nvars\n"}},{"html_id":"failed?:Bool-instance-method","name":"failed?","doc":"\nHas this failed?\n","summary":"

Has this failed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":202,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L202"},"def":{"name":"failed?","return_type":"Bool","visibility":"Public","body":"@failed ? true : false"}},{"html_id":"id:Int32-instance-method","name":"id","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L15"},"def":{"name":"id","visibility":"Public","body":"@id"}},{"html_id":"on_stop-instance-method","name":"on_stop","doc":"\nA method that will be called when this instance has been stopped and it isn't going to be\nstarted again\n","summary":"

A method that will be called when this instance has been stopped and it isn't going to be started again

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":226,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L226"},"def":{"name":"on_stop","visibility":"Public","body":"@started_at = nil\n@stopped = true\ntidy\n"}},{"html_id":"pid:Int64-instance-method","name":"pid","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"pid","visibility":"Public","body":"@pid"}},{"html_id":"pid=(pid:Int64)-instance-method","name":"pid=","abstract":false,"args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"args_string":"(pid : Int64)","args_html":"(pid : Int64)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"pid=","args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"visibility":"Public","body":"@pid = pid"}},{"html_id":"pid_file_path:String-instance-method","name":"pid_file_path","doc":"\nReturn the path to this instance's PID file\n","summary":"

Return the path to this instance's PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L71"},"def":{"name":"pid_file_path","return_type":"String","visibility":"Public","body":"File.join(@process.config.pid_root, \"#{description}.pid\")"}},{"html_id":"pid_from_file:Int64|Nil-instance-method","name":"pid_from_file","doc":"\nReturn the PID that is in the instances process PID file\n","summary":"

Return the PID that is in the instances process PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L78"},"def":{"name":"pid_from_file","return_type":"Int64 | ::Nil","visibility":"Public","body":"if File.exists?(pid_file_path)\n pid = File.read(pid_file_path)\n pid.empty? ? nil : pid.strip.to_i64\nend"}},{"html_id":"port:Int32?-instance-method","name":"port","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"port","visibility":"Public","body":"@port"}},{"html_id":"port=(port:Int32|Nil)-instance-method","name":"port=","abstract":false,"args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"args_string":"(port : Int32 | Nil)","args_html":"(port : Int32 | Nil)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"port=","args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"@port = port"}},{"html_id":"port_available?(port):Bool-instance-method","name":"port_available?","doc":"\nIs the given port available?\n","summary":"

Is the given port available?

","abstract":false,"args":[{"name":"port","external_name":"port","restriction":""}],"args_string":"(port) : Bool","args_html":"(port) : Bool","location":{"filename":"src/procodile/instance.cr","line_number":408,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L408"},"def":{"name":"port_available?","args":[{"name":"port","external_name":"port","restriction":""}],"return_type":"Bool","visibility":"Public","body":"begin\n case @process.network_protocol\n when \"tcp\"\n server = TCPServer.new(\"127.0.0.1\", port)\n server.close\n true\n when \"udp\"\n server = UDPSocket.new\n server.bind(\"127.0.0.1\", port)\n server.close\n true\n else\n raise(Procodile::Error.new(\"Invalid network_protocol '#{@process.network_protocol}'\"))\n end\nrescue Socket::BindError\n false\nend"}},{"html_id":"process:Procodile::Process-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"process","visibility":"Public","body":"@process"}},{"html_id":"process=(process:Procodile::Process)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"args_string":"(process : Procodile::Process)","args_html":"(process : Procodile::Process)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L14"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"visibility":"Public","body":"@process = process"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","doc":"\nReturn the number of times this process has been respawned in the last hour\n","summary":"

Return the number of times this process has been respawned in the last hour

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":343,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L343"},"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif (@respawns.nil? || last_respawn.nil?) || last_respawn < (Time.local - @process.respawn_window.seconds)\n 0\nelse\n @respawns\nend\n"}},{"html_id":"restart:self|Nil-instance-method","name":"restart","doc":"\nRetarts the process using the appropriate method from the process configuration\n","summary":"

Retarts the process using the appropriate method from the process configuration

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":243,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L243"},"def":{"name":"restart","return_type":"self | ::Nil","visibility":"Public","body":"restart_mode = @process.restart_mode\nProcodile.log(@process.log_color, description, \"Restarting using #{restart_mode} mode\")\nupdate_pid\ncase restart_mode\nwhen Signal::USR1, Signal::USR2\n if running?\n ::Process.signal(restart_mode.as(Signal), @pid)\n if @supervisor.tag\n @tag = @supervisor.tag\n end\n Procodile.log(@process.log_color, description, \"Sent #{restart_mode.to_s.upcase} signal to process #{@pid}\")\n else\n Procodile.log(@process.log_color, description, \"Process not running already. Starting it.\")\n on_stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n new_instance.start\n end\n self\nwhen \"start-term\"\n new_instance = @process.create_instance(@supervisor)\n new_instance.start\n stop\n new_instance\nwhen \"term-start\"\n stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n spawn do\n while running?\n sleep(0.5)\n end\n new_instance.start\n end\n new_instance\nend\n"}},{"html_id":"running?:Bool-instance-method","name":"running?","doc":"\nIs this process running? Pass an option to check the given PID instead of the instance\n","summary":"

Is this process running? Pass an option to check the given PID instead of the instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L88"},"def":{"name":"running?","return_type":"Bool","visibility":"Public","body":"begin\n if ( pid = @pid)\n ::Process.pgid(pid) ? true : false\n else\n false\n end\nrescue RuntimeError\n false\nend"}},{"html_id":"should_be_running?:Bool-instance-method","name":"should_be_running?","doc":"\nShould this process be running?\n","summary":"

Should this process be running?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L50"},"def":{"name":"should_be_running?","return_type":"Bool","visibility":"Public","body":"!(stopped? || stopping?)"}},{"html_id":"start-instance-method","name":"start","doc":"\nStart a new instance of this process\n","summary":"

Start a new instance of this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":101,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L101"},"def":{"name":"start","visibility":"Public","body":"if stopping?\n Procodile.log(@process.log_color, description, \"Process is stopped/stopping therefore cannot be started again.\")\n return false\nend\nupdate_pid\nif running?\n Procodile.log(@process.log_color, description, \"Already running with PID #{@pid}\")\n nil\nelse\n port_allocations = @supervisor.run_options.port_allocations\n if port_allocations && (chosen_port = port_allocations[@process.name]?)\n if chosen_port == 0\n allocate_port\n else\n @port = chosen_port\n Procodile.log(@process.log_color, description, \"Assigned #{chosen_port} to process\")\n end\n else\n if @process.proxy? && @supervisor.tcp_proxy\n allocate_port\n else\n if (proposed_port = @process.allocate_port_from) && (@process.restart_mode != \"start-term\")\n process = @supervisor.processes[@process]\n allocated_ports = process ? process.select(&.running?).map(&.port) : [] of Int32\n while !@port\n if allocated_ports.includes?(proposed_port)\n else\n @port = proposed_port\n end\n proposed_port = proposed_port + 1\n end\n end\n end\n end\n if self.process.log_path && (@supervisor.run_options.force_single_log != true)\n FileUtils.mkdir_p(File.dirname(self.process.log_path))\n log_destination = File.open(self.process.log_path, \"a\")\n io = nil\n else\n reader, writer = IO.pipe\n log_destination = writer\n io = reader\n end\n if @supervisor.tag\n @tag = @supervisor.tag.dup\n end\n Dir.cd(@process.config.root)\n commands = @process.command.split(\" \")\n process = ::Process.new(command: commands[0], args: commands[1..], env: environment_variables, output: log_destination, error: log_destination)\n @pid = process.pid\n log_destination.close\n File.write(pid_file_path, \"#{@pid}\\n\")\n @supervisor.add_instance(self, io)\n spawn do\n process.wait\n end\n Procodile.log(@process.log_color, description, \"Started with PID #{@pid}\" + (@tag ? \" (tagged with #{@tag})\" : \"\"))\n if self.process.log_path && io.nil?\n Procodile.log(@process.log_color, description, \"Logging to #{self.process.log_path}\")\n end\n @started_at = Time.local\nend\n"}},{"html_id":"status:String-instance-method","name":"status","doc":"\nReturn the status of this instance\n","summary":"

Return the status of this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":33,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L33"},"def":{"name":"status","return_type":"String","visibility":"Public","body":"if stopped?\n \"Stopped\"\nelse\n if stopping?\n \"Stopping\"\n else\n if running?\n \"Running\"\n else\n if failed?\n \"Failed\"\n else\n \"Unknown\"\n end\n end\n end\nend"}},{"html_id":"stop-instance-method","name":"stop","doc":"\nSend this signal the signal to stop and mark the instance in a state that\ntells us that we want it to be stopped.\n","summary":"

Send this signal the signal to stop and mark the instance in a state that tells us that we want it to be stopped.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":210,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L210"},"def":{"name":"stop","visibility":"Public","body":"@stopping = Time.local\nupdate_pid\nif self.running?\n Procodile.log(@process.log_color, description, \"Sending #{@process.term_signal} to #{@pid}\")\n ::Process.signal(@process.term_signal, pid.not_nil!)\nelse\n Procodile.log(@process.log_color, description, \"Process already stopped\")\nend\n"}},{"html_id":"stopped?:Bool-instance-method","name":"stopped?","doc":"\nIs this stopped?\n","summary":"

Is this stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":195,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L195"},"def":{"name":"stopped?","return_type":"Bool","visibility":"Public","body":"@stopped || false"}},{"html_id":"stopping?:Bool-instance-method","name":"stopping?","doc":"\nIs this instance supposed to be stopping/be stopped?\n","summary":"

Is this instance supposed to be stopping/be stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":188,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L188"},"def":{"name":"stopping?","return_type":"Bool","visibility":"Public","body":"@stopping ? true : false"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L15"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tidy-instance-method","name":"tidy","doc":"\nTidy up when this process isn't needed any more\n","summary":"

Tidy up when this process isn't needed any more

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":235,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L235"},"def":{"name":"tidy","visibility":"Public","body":"FileUtils.rm_rf(self.pid_file_path)\nProcodile.log(@process.log_color, description, \"Removed PID file\")\n"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn this instance as a hash\n","summary":"

Return this instance as a hash

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":370,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L370"},"def":{"name":"to_hash","visibility":"Public","body":"started_at = @started_at\nInstanceConfig.new(description: self.description, pid: self.pid, respawns: self.respawns, status: self.status, running: self.running?, started_at: started_at ? started_at.to_unix : nil, tag: self.tag, port: @port)\n"}},{"html_id":"update_pid:Bool-instance-method","name":"update_pid","doc":"\nUpdate the locally cached PID from that stored on the file system.\n","summary":"

Update the locally cached PID from that stored on the file system.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":288,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/instance.cr#L288"},"def":{"name":"update_pid","return_type":"Bool","visibility":"Public","body":"pid_from_file = self.pid_from_file\nif pid_from_file && (pid_from_file != @pid)\n @pid = pid_from_file\n @started_at = (File.info(self.pid_file_path)).modification_time\n Procodile.log(@process.log_color, description, \"PID file changed. Updated pid to #{@pid}\")\n true\nelse\n false\nend\n"}}]},{"html_id":"procodile/Procodile/InstanceConfig","path":"Procodile/InstanceConfig.html","kind":"struct","full_name":"Procodile::InstanceConfig","name":"InstanceConfig","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(description:String,pid:Int64|Nil,respawns:Int32,status:String,running:Bool,started_at:Int64|Nil,tag:String|Nil,port:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"args_string":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","args_html":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"new","args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(description, pid, respawns, status, running, started_at, tag, port)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":122,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L122"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@description.clone, @pid.clone, @respawns.clone, @status.clone, @running.clone, @started_at.clone, @tag.clone, @port.clone)"}},{"html_id":"copy_with(description_description=@description,pid_pid=@pid,respawns_respawns=@respawns,status_status=@status,running_running=@running,started_at_started_at=@started_at,tag_tag=@tag,port_port=@port)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"args_string":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","args_html":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L113"},"def":{"name":"copy_with","args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"visibility":"Public","body":"self.class.new(_description, _pid, _respawns, _status, _running, _started_at, _tag, _port)"}},{"html_id":"description:String-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String","visibility":"Public","body":"@description"}},{"html_id":"pid:Int64|Nil-instance-method","name":"pid","abstract":false,"def":{"name":"pid","return_type":"Int64 | ::Nil","visibility":"Public","body":"@pid"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","abstract":false,"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"@respawns"}},{"html_id":"running:Bool-instance-method","name":"running","abstract":false,"def":{"name":"running","return_type":"Bool","visibility":"Public","body":"@running"}},{"html_id":"started_at:Int64|Nil-instance-method","name":"started_at","abstract":false,"def":{"name":"started_at","return_type":"Int64 | ::Nil","visibility":"Public","body":"@started_at"}},{"html_id":"status:String-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String","visibility":"Public","body":"@status"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Message","path":"Procodile/Message.html","kind":"module","full_name":"Procodile::Message","name":"Message","abstract":false,"locations":[{"filename":"src/procodile/message.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"parse(message)-class-method","name":"parse","abstract":false,"args":[{"name":"message","external_name":"message","restriction":""}],"args_string":"(message)","args_html":"(message)","location":{"filename":"src/procodile/message.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/message.cr#L3"},"def":{"name":"parse","args":[{"name":"message","external_name":"message","restriction":""}],"visibility":"Public","body":"case message.type\nwhen \"not_running\"\n \"#{message.instance} is not running (#{message.status})\"\nwhen \"incorrect_quantity\"\n \"#{message.process} only has #{message.current} instances (should have #{message.desired})\"\nend"}}]},{"html_id":"procodile/Procodile/Process","path":"Procodile/Process.html","kind":"class","full_name":"Procodile::Process","name":"Process","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/process.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MUTEX","name":"MUTEX","value":"Mutex.new"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,name:String,command:String,options:Procodile::ProcessOption=ProcessOption.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","args_html":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","location":{"filename":"src/procodile/process.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L16"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, name, command, options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","doc":"\nReturn the first port that ports should be allocated from for this process\n","summary":"

Return the first port that ports should be allocated from for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":124,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L124"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@options.allocate_port_from"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"command","visibility":"Public","body":"@command"}},{"html_id":"command=(command:String)-instance-method","name":"command=","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"::String"}],"args_string":"(command : String)","args_html":"(command : String)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"command=","args":[{"name":"command","external_name":"command","restriction":"::String"}],"visibility":"Public","body":"@command = command"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"correct_quantity?(quantity)-instance-method","name":"correct_quantity?","doc":"\nIs the given quantity suitable for this process?\n","summary":"

Is the given quantity suitable for this process?

","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":""}],"args_string":"(quantity)","args_html":"(quantity)","location":{"filename":"src/procodile/process.cr","line_number":198,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L198"},"def":{"name":"correct_quantity?","args":[{"name":"quantity","external_name":"quantity","restriction":""}],"visibility":"Public","body":"if self.restart_mode == \"start-term\"\n quantity >= self.quantity\nelse\n self.quantity == quantity\nend"}},{"html_id":"create_instance(supervisor):Instance-instance-method","name":"create_instance","doc":"\nCreate a new instance\n","summary":"

Create a new instance

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor) : Instance","args_html":"(supervisor) : Instance","location":{"filename":"src/procodile/process.cr","line_number":166,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L166"},"def":{"name":"create_instance","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"return_type":"Instance","visibility":"Public","body":"Instance.new(supervisor, self, get_instance_id)"}},{"html_id":"default_log_file_name:String-instance-method","name":"default_log_file_name","doc":"\nReturn the defualt log file name\n","summary":"

Return the defualt log file name

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L86"},"def":{"name":"default_log_file_name","return_type":"String","visibility":"Public","body":"@options.log_file_name || \"#{@name}.log\""}},{"html_id":"default_log_path:String-instance-method","name":"default_log_path","doc":"\nReturn the log path for this process if no log path is provided and split logs\nis enabled\n","summary":"

Return the log path for this process if no log path is provided and split logs is enabled

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":94,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L94"},"def":{"name":"default_log_path","return_type":"String","visibility":"Public","body":"if (lr = @config.log_root)\n File.join(lr, default_log_file_name)\nelse\n File.join(@config.root, default_log_file_name)\nend"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn all environment variables for this process\n","summary":"

Return all environment variables for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L34"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"global_variables = @config.environment_variables\nprocess_vars = if (process = @config.process_options[@name]?)\n process.env || ({} of String => String)\nelse\n {} of String => String\nend\nprocess_local_vars = if (local_process = @config.local_process_options[@name]?)\n local_process.env || ({} of String => String)\nelse\n {} of String => String\nend\nglobal_variables.merge(process_vars.merge(process_local_vars))\n"}},{"html_id":"generate_instances(supervisor,quantity=self.quantity):Array(Procodile::Instance)-instance-method","name":"generate_instances","doc":"\nGenerate an array of new instances for this process (based on its quantity)\n","summary":"

Generate an array of new instances for this process (based on its quantity)

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"args_string":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","args_html":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","location":{"filename":"src/procodile/process.cr","line_number":159,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L159"},"def":{"name":"generate_instances","args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"Array.new(quantity) do\n create_instance(supervisor)\nend"}},{"html_id":"get_instance_id:Int32-instance-method","name":"get_instance_id","doc":"\nIncrease the instance index and return\n","summary":"

Increase the instance index and return

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L24"},"def":{"name":"get_instance_id","return_type":"Int32","visibility":"Public","body":"MUTEX.synchronize do\n if @instance_index == 10000\n @instance_index = 0\n end\n @instance_index = @instance_index + 1\nend"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"log_color","visibility":"Public","body":"@log_color"}},{"html_id":"log_color=(log_color:Int32)-instance-method","name":"log_color=","abstract":false,"args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"args_string":"(log_color : Int32)","args_html":"(log_color : Int32)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"log_color=","args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"visibility":"Public","body":"@log_color = log_color"}},{"html_id":"log_path:String-instance-method","name":"log_path","doc":"\nReturn the path where log output for this process should be written to. If\nnone, output will be written to the supervisor log.\n","summary":"

Return the path where log output for this process should be written to.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L77"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = @options.log_path\nlog_path ? File.expand_path(log_path, @config.root) : default_log_path\n"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","doc":"\nThe maximum number of times this process can be respawned in the given period\n","summary":"

The maximum number of times this process can be respawned in the given period

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":62,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L62"},"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@options.max_respawns || 5"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L13"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"network_protocol:String-instance-method","name":"network_protocol","doc":"\nReturn the network protocol for this process\n","summary":"

Return the network protocol for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L152"},"def":{"name":"network_protocol","return_type":"String","visibility":"Public","body":"@options.network_protocol || \"tcp\""}},{"html_id":"options:Procodile::ProcessOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::ProcessOption)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(options : Procodile::ProcessOption)","args_html":"(options : Procodile::ProcessOption)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"@options = options"}},{"html_id":"proxy?:Bool-instance-method","name":"proxy?","doc":"\nIs this process enabled for proxying?\n","summary":"

Is this process enabled for proxying?

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L131"},"def":{"name":"proxy?","return_type":"Bool","visibility":"Public","body":"!(!@options.proxy_port)"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L145"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_address || \"127.0.0.1\" : nil"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L138"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_port : nil"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","doc":"\nHow many instances of this process should be started\n","summary":"

How many instances of this process should be started

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L55"},"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@options.quantity || 1"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"removed","visibility":"Public","body":"@removed"}},{"html_id":"removed=(removed:Bool)-instance-method","name":"removed=","abstract":false,"args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"args_string":"(removed : Bool)","args_html":"(removed : Bool)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L14"},"def":{"name":"removed=","args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"visibility":"Public","body":"@removed = removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","doc":"\nThe respawn window. One hour by default.\n","summary":"

The respawn window.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":69,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L69"},"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@options.respawn_window || 3600"}},{"html_id":"restart_mode:String|Signal-instance-method","name":"restart_mode","doc":"\nDefines how this process should be restarted\n\nstart-term = start new instances and send term to children\nusr1 = just send a usr1 signal to the current instance\nusr2 = just send a usr2 signal to the current instance\nterm-start = stop the old instances, when no longer running, start a new one\n","summary":"

Defines how this process should be restarted

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":117,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L117"},"def":{"name":"restart_mode","return_type":"String | Signal","visibility":"Public","body":"@options.restart_mode || \"term-start\""}},{"html_id":"term_signal:Signal-instance-method","name":"term_signal","doc":"\nReturn the signal to send to terminate the process\n","summary":"

Return the signal to send to terminate the process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L105"},"def":{"name":"term_signal","return_type":"Signal","visibility":"Public","body":"@options.term_signal || Signal::TERM"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn a hash\n","summary":"

Return a hash

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":179,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/process.cr#L179"},"def":{"name":"to_hash","visibility":"Public","body":"ControlClientProcessStatus.new(name: self.name, log_color: self.log_color, quantity: self.quantity, max_respawns: self.max_respawns, respawn_window: self.respawn_window, command: self.command, restart_mode: self.restart_mode, log_path: self.log_path, removed: self.removed ? true : false, proxy_port: proxy_port, proxy_address: proxy_address)"}}]},{"html_id":"procodile/Procodile/ProcessOption","path":"Procodile/ProcessOption.html","kind":"struct","full_name":"Procodile::ProcessOption","name":"ProcessOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L7"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L22"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@allocate_port_from"}},{"html_id":"allocate_port_from=(allocate_port_from:Int32|Nil)-instance-method","name":"allocate_port_from=","abstract":false,"args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"args_string":"(allocate_port_from : Int32 | Nil)","args_html":"(allocate_port_from : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from=","args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@allocate_port_from = allocate_port_from"}},{"html_id":"env:Hash(String,String)-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L20"},"def":{"name":"env","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String))-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"args_string":"(env : Hash(String, String))","args_html":"(env : Hash(String, String))","location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L20"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"visibility":"Public","body":"@env = env"}},{"html_id":"log_file_name:String|Nil-instance-method","name":"log_file_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name","return_type":"String | ::Nil","visibility":"Public","body":"@log_file_name"}},{"html_id":"log_file_name=(log_file_name:String|Nil)-instance-method","name":"log_file_name=","abstract":false,"args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"args_string":"(log_file_name : String | Nil)","args_html":"(log_file_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name=","args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_file_name = log_file_name"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"max_respawns:Int32|Nil-instance-method","name":"max_respawns","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns","return_type":"Int32 | ::Nil","visibility":"Public","body":"@max_respawns"}},{"html_id":"max_respawns=(max_respawns:Int32|Nil)-instance-method","name":"max_respawns=","abstract":false,"args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"args_string":"(max_respawns : Int32 | Nil)","args_html":"(max_respawns : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns=","args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@max_respawns = max_respawns"}},{"html_id":"merge(other:self|Nil)-instance-method","name":"merge","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"args_string":"(other : self | Nil)","args_html":"(other : self | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L25"},"def":{"name":"merge","args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"visibility":"Public","body":"new_process_option = self\nif other.quantity\n new_process_option.quantity = other.quantity\nend\nif other.restart_mode\n new_process_option.restart_mode = other.restart_mode\nend\nif other.max_respawns\n new_process_option.max_respawns = other.max_respawns\nend\nif other.respawn_window\n new_process_option.respawn_window = other.respawn_window\nend\nif other.log_path\n new_process_option.log_path = other.log_path\nend\nif other.log_file_name\n new_process_option.log_file_name = other.log_file_name\nend\nif other.term_signal\n new_process_option.term_signal = other.term_signal\nend\nif other.allocate_port_from\n new_process_option.allocate_port_from = other.allocate_port_from\nend\nif other.proxy_port\n new_process_option.proxy_port = other.proxy_port\nend\nif other.proxy_address\n new_process_option.proxy_address = other.proxy_address\nend\nif other.network_protocol\n new_process_option.network_protocol = other.network_protocol\nend\nif other.env\n new_process_option.env = new_process_option.env.merge(other.env)\nend\nnew_process_option\n"}},{"html_id":"network_protocol:String|Nil-instance-method","name":"network_protocol","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol","return_type":"String | ::Nil","visibility":"Public","body":"@network_protocol"}},{"html_id":"network_protocol=(network_protocol:String|Nil)-instance-method","name":"network_protocol=","abstract":false,"args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"args_string":"(network_protocol : String | Nil)","args_html":"(network_protocol : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol=","args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"visibility":"Public","body":"@network_protocol = network_protocol"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_address=(proxy_address:String|Nil)-instance-method","name":"proxy_address=","abstract":false,"args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(proxy_address : String | Nil)","args_html":"(proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address=","args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"@proxy_address = proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"proxy_port=(proxy_port:Int32|Nil)-instance-method","name":"proxy_port=","abstract":false,"args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"args_string":"(proxy_port : Int32 | Nil)","args_html":"(proxy_port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port=","args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@proxy_port = proxy_port"}},{"html_id":"quantity:Int32|Nil-instance-method","name":"quantity","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity","return_type":"Int32 | ::Nil","visibility":"Public","body":"@quantity"}},{"html_id":"quantity=(quantity:Int32|Nil)-instance-method","name":"quantity=","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"args_string":"(quantity : Int32 | Nil)","args_html":"(quantity : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity=","args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@quantity = quantity"}},{"html_id":"respawn_window:Int32|Nil-instance-method","name":"respawn_window","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window","return_type":"Int32 | ::Nil","visibility":"Public","body":"@respawn_window"}},{"html_id":"respawn_window=(respawn_window:Int32|Nil)-instance-method","name":"respawn_window=","abstract":false,"args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"args_string":"(respawn_window : Int32 | Nil)","args_html":"(respawn_window : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window=","args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@respawn_window = respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}},{"html_id":"restart_mode=(restart_mode:Signal|String|Nil)-instance-method","name":"restart_mode=","abstract":false,"args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"args_string":"(restart_mode : Signal | String | Nil)","args_html":"(restart_mode : Signal | String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode=","args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"visibility":"Public","body":"@restart_mode = restart_mode"}},{"html_id":"term_signal:Signal|Nil-instance-method","name":"term_signal","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal","return_type":"Signal | ::Nil","visibility":"Public","body":"@term_signal"}},{"html_id":"term_signal=(term_signal:Signal|Nil)-instance-method","name":"term_signal=","abstract":false,"args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"args_string":"(term_signal : Signal | Nil)","args_html":"(term_signal : Signal | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal=","args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"visibility":"Public","body":"@term_signal = term_signal"}}]},{"html_id":"procodile/Procodile/ProcfileOption","path":"Procodile/ProcfileOption.html","kind":"struct","full_name":"Procodile::ProcfileOption","name":"ProcfileOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L45"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":46,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L46"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":60,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L60"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String|Nil-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name","return_type":"String | ::Nil","visibility":"Public","body":"@app_name"}},{"html_id":"app_name=(app_name:String|Nil)-instance-method","name":"app_name=","abstract":false,"args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"args_string":"(app_name : String | Nil)","args_html":"(app_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name=","args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@app_name = app_name"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"@console_command"}},{"html_id":"console_command=(console_command:String|Nil)-instance-method","name":"console_command=","abstract":false,"args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"args_string":"(console_command : String | Nil)","args_html":"(console_command : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command=","args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"visibility":"Public","body":"@console_command = console_command"}},{"html_id":"env:Hash(String,String)|Nil-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L57"},"def":{"name":"env","return_type":"Hash(String, String) | ::Nil","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String)|Nil)-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"args_string":"(env : Hash(String, String) | Nil)","args_html":"(env : Hash(String, String) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L57"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"visibility":"Public","body":"@env = env"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"@exec_prefix"}},{"html_id":"exec_prefix=(exec_prefix:String|Nil)-instance-method","name":"exec_prefix=","abstract":false,"args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"args_string":"(exec_prefix : String | Nil)","args_html":"(exec_prefix : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix=","args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"visibility":"Public","body":"@exec_prefix = exec_prefix"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"log_root=(log_root:String|Nil)-instance-method","name":"log_root=","abstract":false,"args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(log_root : String | Nil)","args_html":"(log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root=","args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_root = log_root"}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"@pid_root"}},{"html_id":"pid_root=(pid_root:String|Nil)-instance-method","name":"pid_root=","abstract":false,"args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"args_string":"(pid_root : String | Nil)","args_html":"(pid_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root=","args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@pid_root = pid_root"}},{"html_id":"processes:Hash(String,ProcessOption)|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes","return_type":"Hash(String, ProcessOption) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:Hash(String,ProcessOption)|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"args_string":"(processes : Hash(String, ProcessOption) | Nil)","args_html":"(processes : Hash(String, ProcessOption) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"procfile:String|Nil-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile","return_type":"String | ::Nil","visibility":"Public","body":"@procfile"}},{"html_id":"procfile=(procfile:String|Nil)-instance-method","name":"procfile=","abstract":false,"args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(procfile : String | Nil)","args_html":"(procfile : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile=","args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"@procfile = procfile"}},{"html_id":"root:String|Nil-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L49"},"def":{"name":"root","return_type":"String | ::Nil","visibility":"Public","body":"@root"}},{"html_id":"root=(root:String|Nil)-instance-method","name":"root=","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"args_string":"(root : String | Nil)","args_html":"(root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L49"},"def":{"name":"root=","args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@root = root"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L54"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"@user"}},{"html_id":"user=(user:String|Nil)-instance-method","name":"user=","abstract":false,"args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"args_string":"(user : String | Nil)","args_html":"(user : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L54"},"def":{"name":"user=","args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"visibility":"Public","body":"@user = user"}}]},{"html_id":"procodile/Procodile/RunOptions","path":"Procodile/RunOptions.html","kind":"struct","full_name":"Procodile::RunOptions","name":"RunOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"force_single_log:Bool|Nil-instance-method","name":"force_single_log","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log","return_type":"Bool | ::Nil","visibility":"Public","body":"@force_single_log"}},{"html_id":"force_single_log=(force_single_log:Bool|Nil)-instance-method","name":"force_single_log=","abstract":false,"args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"args_string":"(force_single_log : Bool | Nil)","args_html":"(force_single_log : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log=","args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@force_single_log = force_single_log"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L105"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}}]},{"html_id":"procodile/Procodile/SignalHandler","path":"Procodile/SignalHandler.html","kind":"class","full_name":"Procodile::SignalHandler","name":"SignalHandler","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/signal_handler.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"QUEUE","name":"QUEUE","value":"[] of Signal"},{"id":"SIGNALS","name":"SIGNALS","value":"{Signal::TERM, Signal::USR1, Signal::USR2, Signal::INT, Signal::HUP}"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L14"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"handle-instance-method","name":"handle","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L45"},"def":{"name":"handle","visibility":"Public","body":"if (signal = QUEUE.shift?)\n Procodile.log(nil, \"system\", \"Supervisor received #{signal} signal\")\n @handlers[signal].try(&.each(&.call))\nend"}},{"html_id":"notice-instance-method","name":"notice","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":41,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L41"},"def":{"name":"notice","visibility":"Public","body":"@pipe[:writer].write(\".\".to_slice)"}},{"html_id":"pipe:Hash(Symbol,IO::FileDescriptor)-instance-method","name":"pipe","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L12"},"def":{"name":"pipe","return_type":"Hash(Symbol, IO::FileDescriptor)","visibility":"Public","body":"@pipe"}},{"html_id":"register(signal:Signal,&block)-instance-method","name":"register","abstract":false,"args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"args_string":"(signal : Signal, &block)","args_html":"(signal : Signal, &block)","location":{"filename":"src/procodile/signal_handler.cr","line_number":36,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L36"},"def":{"name":"register","args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"__temp_54 = signal\n@handlers[__temp_54]? || (@handlers[__temp_54] = [] of Proc(Nil))\n@handlers[signal] << block\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/signal_handler.cr#L27"},"def":{"name":"start","visibility":"Public","body":"spawn do\n loop do\n handle\n sleep(1)\n end\nend"}}]},{"html_id":"procodile/Procodile/StatusCLIOutput","path":"Procodile/StatusCLIOutput.html","kind":"class","full_name":"Procodile::StatusCLIOutput","name":"StatusCLIOutput","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/status_cli_output.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(status:Procodile::ControlClientReplyForStatusCommand)-class-method","name":"new","abstract":false,"args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"args_string":"(status : Procodile::ControlClientReplyForStatusCommand)","args_html":"(status : Procodile::ControlClientReplyForStatusCommand)","location":{"filename":"src/procodile/status_cli_output.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L5"},"def":{"name":"new","args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"visibility":"Public","body":"_ = allocate\n_.initialize(status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"print_all-instance-method","name":"print_all","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L8"},"def":{"name":"print_all","visibility":"Public","body":"print_header\nprint_processes\n"}},{"html_id":"print_header-instance-method","name":"print_header","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L13"},"def":{"name":"print_header","visibility":"Public","body":"puts(\"Procodile Version #{@status.version.to_s.color(34)}\")\nputs(\"Application Root #{(@status.root).to_s.color(34)}\")\nputs(\"Supervisor PID #{(@status.supervisor[\"pid\"]).to_s.color(34)}\")\nif (time = @status.supervisor[\"started_at\"])\n time = Time.unix(time)\n puts(\"Started #{time.to_s.color(34)}\")\nend\nif !@status.environment_variables.empty?\n @status.environment_variables.each_with_index do |__arg0, index|\n key = __arg0[0]\n value = __arg0[1]\n if index == 0\n print(\"Environment Vars \")\n else\n print(\" \")\n end\n print(key.color(34))\n puts(\" #{value}\")\n end\nend\nif @status.messages.empty?\nelse\n puts\n @status.messages.each do |message|\n puts(\"\\e[31m * #{Message.parse(message)}\\e[0m\")\n end\nend\n"}},{"html_id":"print_processes-instance-method","name":"print_processes","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":40,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/status_cli_output.cr#L40"},"def":{"name":"print_processes","visibility":"Public","body":"puts\n@status.processes.each_with_index do |process, index|\n if index == 0\n else\n puts\n end\n puts((\"|| \".color(process.log_color)) + (process.name.color(process.log_color)))\n puts(\"#{\"||\".color(process.log_color)} Quantity #{process.quantity}\")\n puts(\"#{\"||\".color(process.log_color)} Command #{process.command}\")\n puts(\"#{\"||\".color(process.log_color)} Respawning #{process.max_respawns} every #{process.respawn_window} seconds\")\n puts(\"#{\"||\".color(process.log_color)} Restart mode #{process.restart_mode}\")\n puts(\"#{\"||\".color(process.log_color)} Log path #{process.log_path || \"none specified\"}\")\n puts(\"#{\"||\".color(process.log_color)} Address/Port #{process.proxy_port ? \"#{process.proxy_address}:#{process.proxy_port}\" : \"none\"}\")\n instances = @status.instances[process.name]\n if instances.empty?\n puts(\"#{\"||\".color(process.log_color)} No processes running.\")\n else\n instances.each do |instance|\n print((\"|| => \".color(process.log_color)) + ((instance.description.to_s.ljust(17, ' ')).color(process.log_color)))\n print(instance.status.ljust(10, ' '))\n print(\" #{(formatted_timestamp(instance.started_at)).ljust(10, ' ')}\")\n print(\" pid:#{instance.pid.to_s.ljust(6, ' ')}\")\n print(\" respawns:#{instance.respawns.to_s.ljust(4, ' ')}\")\n print(\" port:#{(instance.port || '-').to_s.ljust(6, ' ')}\")\n print(\" tag:#{instance.tag || '-'}\")\n puts\n end\n end\nend\n"}}]},{"html_id":"procodile/Procodile/Supervisor","path":"Procodile/Supervisor.html","kind":"class","full_name":"Procodile::Supervisor","name":"Supervisor","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/supervisor.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L9"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,run_options:Procodile::RunOptions=Procodile::RunOptions.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"args_string":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","args_html":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L15"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, run_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_instance(instance,io=nil)-instance-method","name":"add_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"args_string":"(instance, io = nil)","args_html":"(instance, io = nil)","location":{"filename":"src/procodile/supervisor.cr","line_number":234,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L234"},"def":{"name":"add_instance","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"visibility":"Public","body":"if io\n add_reader(instance, io)\nend\n__temp_44 = instance.process\n@processes[__temp_44]? || (@processes[__temp_44] = [] of Procodile::Instance)\nif @processes[instance.process].includes?(instance)\nelse\n @processes[instance.process] << instance\nend\n"}},{"html_id":"add_reader(instance,io)-instance-method","name":"add_reader","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"args_string":"(instance, io)","args_html":"(instance, io)","location":{"filename":"src/procodile/supervisor.cr","line_number":229,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L229"},"def":{"name":"add_reader","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"visibility":"Public","body":"@readers[io] = instance\n@signal_handler.notice\n"}},{"html_id":"allow_respawning?:Bool-instance-method","name":"allow_respawning?","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L27"},"def":{"name":"allow_respawning?","return_type":"Bool","visibility":"Public","body":"@run_options.respawn != false"}},{"html_id":"check_concurrency(options={}ofString=>String):Hash(Symbol,Array(Procodile::Instance))-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","args_html":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","location":{"filename":"src/procodile/supervisor.cr","line_number":175,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L175"},"def":{"name":"check_concurrency","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"return_type":"Hash(Symbol, Array(Procodile::Instance))","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Checking process concurrency\")\nif options.reload == false\nelse\n reload_config\nend\nresult = check_instance_quantities\nif result[:started].empty? && result[:stopped].empty?\n Procodile.log(nil, \"system\", \"Process concurrency looks good\")\nelse\n if result[:started].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check started #{result[:started].map(&.description).join(\", \")}\")\n end\n if result[:stopped].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check stopped #{result[:stopped].map(&.description).join(\", \")}\")\n end\nend\nresult\n"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":203,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L203"},"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"messages = [] of SupervisorMessages\nprocesses.each do |process, process_instances|\n if process.correct_quantity?(process_instances.size)\n else\n messages << SupervisorMessages.new(type: \"incorrect_quantity\", process: process.name, current: process_instances.size, desired: process.quantity)\n end\n process_instances.each do |instance|\n if instance.should_be_running? && (instance.status != \"Running\")\n messages << SupervisorMessages.new(type: \"not_running\", instance: instance.description, status: instance.status)\n end\n end\nend\nmessages\n"}},{"html_id":"processes:Hash(Procodile::Process,Array(Procodile::Instance))-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"processes","visibility":"Public","body":"@processes"}},{"html_id":"reload_config-instance-method","name":"reload_config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L170"},"def":{"name":"reload_config","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Reloading configuration\")\n@config.reload\n"}},{"html_id":"remove_instance(instance)-instance-method","name":"remove_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""}],"args_string":"(instance)","args_html":"(instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":242,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L242"},"def":{"name":"remove_instance","args":[{"name":"instance","external_name":"instance","restriction":""}],"visibility":"Public","body":"if @processes[instance.process]\n @processes[instance.process].delete(instance)\n @readers.delete(instance)\nend"}},{"html_id":"restart(options=SupervisorOptions.new)-instance-method","name":"restart","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new)","args_html":"(options = SupervisorOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L110"},"def":{"name":"restart","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_restarted = [] of Array(Procodile::Instance | ::Nil)\nprocesses = options.processes\nif processes.nil?\n Procodile.log(nil, \"system\", \"Restarting all #{@config.app_name} processes\")\n instances = @processes.values.flatten\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Restarting #{instances.size} process(es)\")\nend\nstopped = (check_instance_quantities(:stopped, processes))[:stopped].map do |i|\n [i, nil]\nend\ninstances_restarted.concat(stopped)\ninstances.each do |instance|\n if instance.stopping?\n next\n end\n new_instance = instance.restart\n instances_restarted << [instance, new_instance]\nend\nchecked = (check_instance_quantities(:started, processes))[:started].map do |i|\n [nil, i]\nend\ninstances_restarted.concat(checked)\ninstances_restarted\n"}},{"html_id":"run_options:Procodile::RunOptions-instance-method","name":"run_options","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"run_options","visibility":"Public","body":"@run_options"}},{"html_id":"start(after_start:Proc(Procodile::Supervisor,Nil))-instance-method","name":"start","abstract":false,"args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"args_string":"(after_start : Proc(Procodile::Supervisor, Nil))","args_html":"(after_start : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/supervisor.cr","line_number":31,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L31"},"def":{"name":"start","args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"visibility":"Public","body":"begin\n Procodile.log(nil, \"system\", \"Procodile supervisor started with PID #{::Process.pid}\")\n Procodile.log(nil, \"system\", \"Application root is #{@config.root}\")\n if @run_options.respawn == false\n Procodile.log(nil, \"system\", \"Automatic respawning is disabled\")\n end\n ControlServer.start(self)\n if @run_options.proxy\n Procodile.log(nil, \"system\", \"Proxy is enabled\")\n @tcp_proxy = TCPProxy.start(self)\n end\n watch_for_output\n @started_at = Time.local\n after_start.call(self)\nrescue e\n Procodile.log(nil, \"system\", \"Error: #{e.class} (#{e.message})\")\n e.backtrace.each do |bt|\n Procodile.log(nil, \"system\", \"=> #{bt})\")\n end\n stop(SupervisorOptions.new(stop_supervisor: true))\nensure\n loop do\n supervise\n sleep(3)\n end\nend"}},{"html_id":"start_processes(process_names:Array(String)|Nil,options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"start_processes","abstract":false,"args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":61,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L61"},"def":{"name":"start_processes","args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_started = [] of Procodile::Instance\n@config.processes.each do |name, process|\n if process_names && (!(process_names.includes?(name.to_s)))\n next\n end\n if @processes[process]? && (!@processes[process].empty?)\n next\n end\n instances = process.generate_instances(self)\n instances.each(&.start)\n instances_started.concat(instances)\nend\ninstances_started\n"}},{"html_id":"started_at:Time?-instance-method","name":"started_at","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"started_at","visibility":"Public","body":"@started_at"}},{"html_id":"stop(options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"stop","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L80"},"def":{"name":"stop","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"if options.stop_supervisor\n @run_options.stop_when_none = true\nend\nreload_config\nprocesses = options.processes\ninstances_stopped = [] of Procodile::Instance\nif processes.nil?\n Procodile.log(nil, \"system\", \"Stopping all #{@config.app_name} processes\")\n @processes.each do |_, instances|\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\n end\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Stopping #{instances.size} process(es)\")\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\nend\ninstances_stopped\n"}},{"html_id":"stop_supervisor-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L145"},"def":{"name":"stop_supervisor","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Stopping Procodile supervisor\")\nFileUtils.rm_rf(File.join(@config.pid_root, \"procodile.pid\"))\n::Process.exit(0)\n"}},{"html_id":"supervise-instance-method","name":"supervise","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":151,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L151"},"def":{"name":"supervise","visibility":"Public","body":"remove_stopped_instances\nremove_removed_processes\n@processes.each do |_, instances|\n instances.each(&.check)\nend\nif @run_options.stop_when_none && @processes.all? do |_, instances|\n instances.reject(&.failed?).empty?\nend\n Procodile.log(nil, \"system\", \"All processes have stopped\")\n stop_supervisor\nend\n"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tcp_proxy:Procodile::TCPProxy?-instance-method","name":"tcp_proxy","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L13"},"def":{"name":"tcp_proxy","visibility":"Public","body":"@tcp_proxy"}},{"html_id":"to_hash-instance-method","name":"to_hash","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":196,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/supervisor.cr#L196"},"def":{"name":"to_hash","visibility":"Public","body":"{started_at: @started_at.not_nil!.to_unix, pid: ::Process.pid}"}}]},{"html_id":"procodile/Procodile/SupervisorMessages","path":"Procodile/SupervisorMessages.html","kind":"struct","full_name":"Procodile::SupervisorMessages","name":"SupervisorMessages","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(type:String,process:String|Nil=nil,current:Int32|Nil=nil,desired:Int32|Nil=nil,instance:String|Nil=nil,status:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"args_string":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","args_html":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"new","args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(type, process, current, desired, instance, status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":147,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L147"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@type.clone, @process.clone, @current.clone, @desired.clone, @instance.clone, @status.clone)"}},{"html_id":"copy_with(type_type=@type,process_process=@process,current_current=@current,desired_desired=@desired,instance_instance=@instance,status_status=@status)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"args_string":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","args_html":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L140"},"def":{"name":"copy_with","args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"visibility":"Public","body":"self.class.new(_type, _process, _current, _desired, _instance, _status)"}},{"html_id":"current:Int32|Nil-instance-method","name":"current","abstract":false,"def":{"name":"current","return_type":"Int32 | ::Nil","visibility":"Public","body":"@current"}},{"html_id":"desired:Int32|Nil-instance-method","name":"desired","abstract":false,"def":{"name":"desired","return_type":"Int32 | ::Nil","visibility":"Public","body":"@desired"}},{"html_id":"instance:String|Nil-instance-method","name":"instance","abstract":false,"def":{"name":"instance","return_type":"String | ::Nil","visibility":"Public","body":"@instance"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"status:String|Nil-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String | ::Nil","visibility":"Public","body":"@status"}},{"html_id":"type:String-instance-method","name":"type","abstract":false,"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"procodile/Procodile/SupervisorOptions","path":"Procodile/SupervisorOptions.html","kind":"struct","full_name":"Procodile::SupervisorOptions","name":"SupervisorOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=nil,stop_supervisor:Bool|Nil=nil,tag:String|Nil=nil,reload:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"new","args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, stop_supervisor, tag, reload)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @stop_supervisor.clone, @tag.clone, @reload.clone)"}},{"html_id":"copy_with(processes_processes=@processes,stop_supervisor_stop_supervisor=@stop_supervisor,tag_tag=@tag,reload_reload=@reload)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"args_string":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","args_html":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/procfile_option.cr#L170"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _stop_supervisor, _tag, _reload)"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/TCPProxy","path":"Procodile/TCPProxy.html","kind":"class","full_name":"Procodile::TCPProxy","name":"TCPProxy","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/tcp_proxy.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L3"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"proxy = new(supervisor)\nproxy.start\nproxy\n"}}],"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"args_string":"(supervisor : Procodile::Supervisor)","args_html":"(supervisor : Procodile::Supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L9"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_process(process)-instance-method","name":"add_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L23"},"def":{"name":"add_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"begin\n if process.proxy?\n @listeners[TCPServer.new(process.proxy_address.not_nil!, process.proxy_port.not_nil!)] = process\n Procodile.log(nil, \"proxy\", \"Proxying traffic on #{process.proxy_address}:#{process.proxy_port} to #{process.name}\".color(32))\n @sp_writer.write(\".\".to_slice)\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nend"}},{"html_id":"handle_client(client,server)-instance-method","name":"handle_client","abstract":false,"args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"args_string":"(client, server)","args_html":"(client, server)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L86"},"def":{"name":"handle_client","args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"visibility":"Public","body":"begin\n process = @listeners[server]\n instances = @supervisor.processes[process]? || ([] of Procodile::Instance)\n if instances.empty?\n Procodile.log(nil, \"proxy\", \"There are no processes running for #{process.name}\")\n else\n instance = instances[rand(instances.size)]\n backend_socket = begin\n TCPSocket.new(\"127.0.0.1\", instance.port)\n rescue\n nil\n end\n if backend_socket.nil?\n Procodile.log(nil, \"proxy\", \"Could not connect to #{instance.description}:#{instance.port}\")\n return\n end\n readers = {:backend => backend_socket, :client => client}\n sleep_chan = Channel(Nil).new\n readers_chan = Channel(Nil).new\n spawn do\n loop do\n sleep(0.5)\n sleep_chan.send(nil)\n end\n end\n readers.values.each do |socket|\n spawn do\n loop do\n key = readers.key_for(socket)\n opposite_side = key == (:client) ? :backend : :client\n if socket.read_byte\n readers.delete(opposite_side)\n else\n begin\n readers[opposite_side].write(Bytes.new(socket.read(Bytes.new(1024))))\n rescue\n nil\n end\n end\n readers_chan.send(nil)\n end\n end\n end\n loop do\n select\nwhen readers_chan.receive\nwhen sleep_chan.receive\nend\n\n end\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nensure\n if backend_socket\n backend_socket.close\n end\n if client\n client.close\n end\nend"}},{"html_id":"listen-instance-method","name":"listen","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":39,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L39"},"def":{"name":"listen","visibility":"Public","body":"sleep_chan = Channel(Nil).new\nsp_reader_chan = Channel(Nil).new\nlistener_chan = Channel(Nil).new\nspawn do\n loop do\n sleep(30)\n sleep_chan.send(nil)\n end\nend\nspawn do\n loop do\n @sp_reader.read(Bytes.new(999))\n sp_reader_chan.send(nil)\n end\nend\n@listeners.keys.each do |io|\n spawn do\n loop do\n handle_client(client: io.accept, server: io)\n listener_chan.send(nil)\n end\n end\nend\nloop do\n select\nwhen sp_reader_chan.receive\nwhen listener_chan.receive\nwhen sleep_chan.receive\nend\n\n @stopped_processes.reject do |process|\n if ( io = @listeners.key_for(process))\n Procodile.log(nil, \"proxy\", \"Stopped proxy listener for #{process.name}\")\n io.close\n @listeners.delete(io)\n end\n true\n end\nend\n"}},{"html_id":"remove_process(process)-instance-method","name":"remove_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L34"},"def":{"name":"remove_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"@stopped_processes << process\n@sp_writer.write(\".\".to_slice)\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/tcp_proxy.cr#L15"},"def":{"name":"start","visibility":"Public","body":"@supervisor.config.processes.each do |_, p|\n add_process(p)\nend\nspawn do\n listen\n Procodile.log(nil, \"proxy\", \"Stopped listening on all ports\")\nend\n"}}]}]},{"html_id":"procodile/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/color.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/color.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nString might end up being conformed of bytes which are an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but\ninvalid byte sequences, when asked as chars, will use the unicode replacement\nchar (value 0xFFFD). For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","instance_methods":[{"html_id":"color(color)-instance-method","name":"color","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""}],"args_string":"(color)","args_html":"(color)","location":{"filename":"src/procodile/color.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/v1.0.19/src/procodile/color.cr#L2"},"def":{"name":"color","args":[{"name":"color","external_name":"color","restriction":""}],"visibility":"Public","body":"\"\\e[#{color}m#{self}\\e[0m\""}}]}]}}) \ No newline at end of file +crystal_doc_search_index_callback({"repository_name":"procodile","body":"# Procodile 🐊\n\nRunning & deploying Ruby apps to places like [Viaduct](https://viaduct.io) & Heroku is really easy but running processes on actual servers is less fun. Procodile aims to take some the stress out of running your Ruby/Rails apps and give you some of the useful process management features you get from the takes of the PaaS providers.\n\nProcodile is a bit like [Foreman](https://github.com/ddollar/foreman) but things are designed to run in the background (as well as the foreground if you prefer) and there's a supervisor which keeps an eye on your processes and will respawn them if they die.\n\nProcodile works out of the box with your existing `Procfile`.\n\n* [Watch a quick screencast](https://vimeo.com/188041935)\n* [Read documentation](https://github.com/adamcooke/procodile/wiki)\n* [View on RubyGems](https://rubygems.org/gems/procodile)\n* [Check the CHANGELOG](https://github.com/adamcooke/procodile/blob/master/CHANGELOG.md)\n\n![Screenshot](https://share.adam.ac/16/cAZRKUM7.png)\n","program":{"html_id":"procodile/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"procodile","program":true,"enum":false,"alias":false,"const":false,"constants":[{"id":"ORIGINAL_ARGV","name":"ORIGINAL_ARGV","value":"ARGV.join(\" \")"}],"types":[{"html_id":"procodile/Procodile","path":"Procodile.html","kind":"module","full_name":"Procodile","name":"Procodile","abstract":false,"locations":[{"filename":"src/procodile.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L6"},{"filename":"src/procodile/app_determination.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L3"},{"filename":"src/procodile/cli.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L6"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L1"},{"filename":"src/procodile/commands/console_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L1"},{"filename":"src/procodile/commands/exec_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L1"},{"filename":"src/procodile/commands/help_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L1"},{"filename":"src/procodile/commands/kill_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L1"},{"filename":"src/procodile/commands/log_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L1"},{"filename":"src/procodile/commands/reload_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L1"},{"filename":"src/procodile/commands/restart_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L1"},{"filename":"src/procodile/commands/run_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L1"},{"filename":"src/procodile/commands/start_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L1"},{"filename":"src/procodile/commands/status_command.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L4"},{"filename":"src/procodile/commands/stop_command.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L1"},{"filename":"src/procodile/config.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L3"},{"filename":"src/procodile/control_client.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L4"},{"filename":"src/procodile/control_server.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L4"},{"filename":"src/procodile/control_session.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L4"},{"filename":"src/procodile/error.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/error.cr#L1"},{"filename":"src/procodile/instance.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L3"},{"filename":"src/procodile/logger.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L3"},{"filename":"src/procodile/message.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L1"},{"filename":"src/procodile/process.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L3"},{"filename":"src/procodile/procfile_option.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L5"},{"filename":"src/procodile/signal_handler.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L1"},{"filename":"src/procodile/status_cli_output.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L3"},{"filename":"src/procodile/supervisor.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L8"},{"filename":"src/procodile/tcp_proxy.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L1"},{"filename":"src/procodile/version.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/version.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/procodile_cr/procodile_cr/src/procodile\\\"`).chomp.stringify }}"}],"class_methods":[{"html_id":"bin_path-class-method","name":"bin_path","abstract":false,"location":{"filename":"src/procodile.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L11"},"def":{"name":"bin_path","visibility":"Public","body":"File.join(root, \"bin\", \"procodile\")"}},{"html_id":"log(color,name,text)-class-method","name":"log","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"args_string":"(color, name, text)","args_html":"(color, name, text)","location":{"filename":"src/procodile/logger.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L8"},"def":{"name":"log","args":[{"name":"color","external_name":"color","restriction":""},{"name":"name","external_name":"name","restriction":""},{"name":"text","external_name":"text","restriction":""}],"visibility":"Public","body":"mutex.synchronize do\n text.to_s.lines.map(&.chomp).each do |message|\n output = \"\"\n output = output + (\"#{Time.local.to_s(\"%H:%M:%S\")} #{name.ljust(18, ' ')} | \".color(color))\n output = output + message\n STDOUT.puts(output)\n STDOUT.flush\n end\nend"}},{"html_id":"mutex:Mutex-class-method","name":"mutex","abstract":false,"location":{"filename":"src/procodile/logger.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/logger.cr#L4"},"def":{"name":"mutex","return_type":"Mutex","visibility":"Public","body":"@@mutex || (@@mutex = Mutex.new)"}},{"html_id":"root-class-method","name":"root","abstract":false,"location":{"filename":"src/procodile.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile.cr#L7"},"def":{"name":"root","visibility":"Public","body":"File.expand_path(\"..\", \"/home/runner/work/procodile_cr/procodile_cr/src\")"}}],"types":[{"html_id":"procodile/Procodile/AppDetermination","path":"Procodile/AppDetermination.html","kind":"class","full_name":"Procodile::AppDetermination","name":"AppDetermination","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/app_determination.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L7"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"doc":"\nThis class is responsible for determining which application should be used\n","summary":"

This class is responsible for determining which application should be used

","constructors":[{"html_id":"new(pwd:String,given_root:String|Nil,given_procfile:String|Nil,global_options=nil)-class-method","name":"new","doc":"Start by creating an determination ased on the root and procfile that has been provided\nto us by the user (from --root and/or --procfile)","summary":"

Start by creating an determination ased on the root and procfile that has been provided to us by the user (from --root and/or --procfile)

","abstract":false,"args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"args_string":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","args_html":"(pwd : String, given_root : String | Nil, given_procfile : String | Nil, global_options = nil)","location":{"filename":"src/procodile/app_determination.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L19"},"def":{"name":"new","args":[{"name":"pwd","external_name":"pwd","restriction":"String"},{"name":"given_root","external_name":"given_root","restriction":"String | ::Nil"},{"name":"given_procfile","external_name":"given_procfile","restriction":"String | ::Nil"},{"name":"global_options","default_value":"nil","external_name":"global_options","restriction":""}],"visibility":"Public","body":"_ = allocate\n_.initialize(pwd, given_root, given_procfile, global_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"procfile:String?-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L15"},"def":{"name":"procfile","visibility":"Public","body":"@procfile"}},{"html_id":"root:String?-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/app_determination.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/app_determination.cr#L15"},"def":{"name":"root","visibility":"Public","body":"@root"}}]},{"html_id":"procodile/Procodile/CLI","path":"Procodile/CLI.html","kind":"class","full_name":"Procodile::CLI","name":"CLI","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/cli.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L7"},{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L2"},{"filename":"src/procodile/commands/console_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L2"},{"filename":"src/procodile/commands/exec_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L2"},{"filename":"src/procodile/commands/help_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L2"},{"filename":"src/procodile/commands/kill_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L2"},{"filename":"src/procodile/commands/log_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L2"},{"filename":"src/procodile/commands/reload_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L2"},{"filename":"src/procodile/commands/restart_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L2"},{"filename":"src/procodile/commands/run_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L2"},{"filename":"src/procodile/commands/start_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L2"},{"filename":"src/procodile/commands/status_command.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L5"},{"filename":"src/procodile/commands/stop_command.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COMMANDS","name":"COMMANDS","value":"[{:help, \"Shows this help output\"}, {:kill, \"Forcefully kill all known processes\"}, {:start, \"Starts processes and/or the supervisor\"}, {:stop, \"Stops processes and/or the supervisor\"}, {:exec, \"Execute a command within the environment\"}, {:run, \"Execute a command within the environment\"}, {:reload, \"Reload Procodile configuration\"}, {:check_concurrency, \"Check process concurrency\"}, {:log, \"Open/stream a Procodile log file\"}, {:restart, \"Restart processes\"}, {:status, \"Show the current status of processes\"}, {:console, \"Open a console within the environment\"}]"}],"included_modules":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand"},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand"},{"html_id":"procodile/Procodile/CLI/ExecCommand","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand"},{"html_id":"procodile/Procodile/CLI/HelpCommand","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand"},{"html_id":"procodile/Procodile/CLI/KillCommand","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand"},{"html_id":"procodile/Procodile/CLI/LogCommand","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand"},{"html_id":"procodile/Procodile/CLI/ReloadCommand","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand"},{"html_id":"procodile/Procodile/CLI/RestartCommand","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand"},{"html_id":"procodile/Procodile/CLI/RunCommand","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand"},{"html_id":"procodile/Procodile/CLI/StartCommand","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand"},{"html_id":"procodile/Procodile/CLI/StatusCommand","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand"},{"html_id":"procodile/Procodile/CLI/StopCommand","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"commands:Hash(String,CliCommand)-class-method","name":"commands","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L24"},"def":{"name":"commands","return_type":"Hash(String, CliCommand)","visibility":"Public","body":"@@commands || (@@commands = {} of String => CliCommand)"}},{"html_id":"options(name,&block:Proc(OptionParser,Procodile::CLI,Nil))-class-method","name":"options","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","args_html":"(name, &block : Proc(OptionParser, Procodile::CLI, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":30,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L30"},"def":{"name":"options","args":[{"name":"name","external_name":"name","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(OptionParser, Procodile::CLI, Nil)"},"visibility":"Public","body":"@@options[name] = block"}},{"html_id":"start_supervisor(config:Procodile::Config,options=Procodile::CliOptions.new,&block:Proc(Procodile::Supervisor,Nil))-class-method","name":"start_supervisor","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"args_string":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","args_html":"(config : Procodile::Config, options = Procodile::CliOptions.new, &block : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/cli.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L66"},"def":{"name":"start_supervisor","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"options","default_value":"Procodile::CliOptions.new","external_name":"options","restriction":""}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":"Proc(Procodile::Supervisor, Nil)"},"visibility":"Public","body":"run_options = Procodile::RunOptions.new\nrun_options.respawn = options.respawn\nrun_options.stop_when_none = options.stop_when_none\nrun_options.proxy = options.proxy\nrun_options.force_single_log = options.foreground\nrun_options.port_allocations = options.port_allocations\ntidy_pids(config)\nif options.clean\n FileUtils.rm_rf(Dir[File.join(config.pid_root, \"*\")])\n puts(\"Emptied PID directory\")\nend\nif !Dir[File.join(config.pid_root, \"*\")].empty?\n raise(Error.new(\"The PID directory (#{config.pid_root}) is not empty. Cannot start unless things are clean.\"))\nend\nFile.write(\"/proc/self/comm\", \"[procodile] #{config.app_name} (#{config.root})\")\nif options.foreground\n File.write(config.supervisor_pid_path, ::Process.pid)\n (Supervisor.new(config, run_options)).start(block)\nelse\n FileUtils.rm_rf(File.join(config.pid_root, \"*.pid\"))\n process = ::Process.fork do\n log_path = File.open(config.log_path, \"a\")\n STDOUT.reopen(log_path)\n STDOUT.sync = true\n STDERR.reopen(log_path)\n STDERR.sync = true\n (Supervisor.new(config, run_options)).start(block)\n end\n spawn do\n process.wait\n end\n pid = process.pid\n File.write(config.supervisor_pid_path, pid)\n puts(\"Started Procodile supervisor with PID #{pid}\")\nend\n"}},{"html_id":"tidy_pids(config:Procodile::Config)-class-method","name":"tidy_pids","doc":"Clean up procodile.pid and procodile.sock with all unused pid files","summary":"

Clean up procodile.pid and procodile.sock with all unused pid files

","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":116,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L116"},"def":{"name":"tidy_pids","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"}],"visibility":"Public","body":"FileUtils.rm_rf(config.supervisor_pid_path)\nFileUtils.rm_rf(config.sock_path)\npid_files = Dir[File.join(config.pid_root, \"*.pid\")]\npid_files.each do |pid_path|\n file_name = (pid_path.split(\"/\")).last\n pid = (File.read(pid_path)).to_i\n if ::Process.exists?(pid)\n puts(\"Could not remove #{file_name} because process (#{pid}) was active\")\n else\n FileUtils.rm_rf(pid_path)\n puts(\"Removed #{file_name} because process was not active\")\n end\nend\n"}}],"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L34"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"config=(config:Procodile::Config)-instance-method","name":"config=","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"args_string":"(config : Procodile::Config)","args_html":"(config : Procodile::Config)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"config=","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"}],"visibility":"Public","body":"@config = config"}},{"html_id":"dispatch(command)-instance-method","name":"dispatch","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command)","args_html":"(command)","location":{"filename":"src/procodile/cli.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L58"},"def":{"name":"dispatch","args":[{"name":"command","external_name":"command","restriction":""}],"visibility":"Public","body":"if self.class.commands.has_key?(command)\n self.class.commands[command].callable.call\nelse\n raise(Error.new(\"Invalid command '#{command}'\"))\nend"}},{"html_id":"options:Procodile::CliOptions-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::CliOptions)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"args_string":"(options : Procodile::CliOptions)","args_html":"(options : Procodile::CliOptions)","location":{"filename":"src/procodile/cli.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/cli.cr#L22"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::CliOptions"}],"visibility":"Public","body":"@options = options"}}],"types":[{"html_id":"procodile/Procodile/CLI/CheckConcurrencyCommand","path":"Procodile/CLI/CheckConcurrencyCommand.html","kind":"module","full_name":"Procodile::CLI::CheckConcurrencyCommand","name":"CheckConcurrencyCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"check_concurrency-instance-method","name":"check_concurrency","abstract":false,"location":{"filename":"src/procodile/commands/check_concurrency_command.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/check_concurrency_command.cr#L12"},"def":{"name":"check_concurrency","visibility":"Public","body":"if supervisor_running?\n reply = (ControlClient.run(@config.sock_path, \"check_concurrency\", reload: @options.reload)).as(NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)))\n if reply[\"started\"].empty? && reply[\"stopped\"].empty?\n puts(\"Processes are running as configured\")\n else\n reply[\"started\"].each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n reply[\"stopped\"].each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ConsoleCommand","path":"Procodile/CLI/ConsoleCommand.html","kind":"module","full_name":"Procodile::CLI::ConsoleCommand","name":"ConsoleCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/console_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"console-instance-method","name":"console","abstract":false,"location":{"filename":"src/procodile/commands/console_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/console_command.cr#L9"},"def":{"name":"console","visibility":"Public","body":"if (cmd = @config.console_command)\n exec(cmd)\nelse\n raise(Error.new(\"No console command has been configured in the Procfile\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/ExecCommand","path":"Procodile/CLI/ExecCommand.html","kind":"module","full_name":"Procodile::CLI::ExecCommand","name":"ExecCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/exec_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"exec(command=nil)-instance-method","name":"exec","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/exec_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/exec_command.cr#L9"},"def":{"name":"exec","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"desired_command = command || (ARGV[1..].join(\" \"))\nif (prefix = @config.exec_prefix)\n desired_command = \"#{prefix} #{desired_command}\"\nend\nif desired_command.empty?\n raise(Error.new(\"You need to specify a command to run (e.g. procodile run -- rake db:migrate)\"))\nelse\n environment = @config.environment_variables\n if ENV[\"PROCODILE_EXEC_QUIET\"]?.try(&.to_i) == 1\n else\n puts(\"Running with #{desired_command.color(33)}\")\n environment.each do |key, value|\n puts(\" #{key.color(34)} #{value}\")\n end\n end\n begin\n Dir.cd(@config.root)\n ::Process.exec(desired_command, env: environment, shell: true)\n rescue e : RuntimeError\n raise(Error.new(e.message))\n end\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/HelpCommand","path":"Procodile/CLI/HelpCommand.html","kind":"module","full_name":"Procodile::CLI::HelpCommand","name":"HelpCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/help_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"help-instance-method","name":"help","abstract":false,"location":{"filename":"src/procodile/commands/help_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/help_command.cr#L9"},"def":{"name":"help","visibility":"Public","body":"puts(\"\\e[45;37mWelcome to Procodile v#{Procodile::VERSION}\\e[0m\")\nputs(\"For documentation see https://adam.ac/procodile.\")\nputs\nputs(\"The following commands are supported:\")\nputs\nself.class.commands.to_a.sort_by do |x|\n x[0]\nend.to_h.each do |method, options|\n if options.description\n puts(\" \\e[34m#{method.to_s.ljust(18, ' ')}\\e[0m #{options.description}\")\n end\nend\nputs\nputs(\"For details for the options available for each command, use the --help option.\")\nputs(\"For example 'procodile start --help'.\")\n"}}]},{"html_id":"procodile/Procodile/CLI/KillCommand","path":"Procodile/CLI/KillCommand.html","kind":"module","full_name":"Procodile::CLI::KillCommand","name":"KillCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/kill_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"kill-instance-method","name":"kill","abstract":false,"location":{"filename":"src/procodile/commands/kill_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/kill_command.cr#L9"},"def":{"name":"kill","visibility":"Public","body":"Dir[File.join(@config.pid_root, \"*.pid\")].each do |pid_path|\n name = (pid_path.split('/')).last.rstrip(\".pid\")\n pid = (File.read(pid_path)).to_i\n begin\n ::Process.signal(Signal::INT, pid)\n puts(\"Sent KILL to #{pid} (#{name})\")\n rescue RuntimeError\n end\n FileUtils.rm(pid_path)\nend"}}]},{"html_id":"procodile/Procodile/CLI/LogCommand","path":"Procodile/CLI/LogCommand.html","kind":"module","full_name":"Procodile::CLI::LogCommand","name":"LogCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/log_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"log-instance-method","name":"log","abstract":false,"location":{"filename":"src/procodile/commands/log_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/log_command.cr#L20"},"def":{"name":"log","visibility":"Public","body":"opts = [] of String\nif options.wait\n opts << \"-f\"\nend\nif options.lines\n opts << \"-n #{options.lines}\"\nend\nprocess = options.process\nif process\n if ( process = @config.processes[process])\n log_path = process.log_path\n else\n raise(Error.new(\"Invalid process name '#{process}'\"))\n end\nelse\n log_path = @config.log_path\nend\nif File.exists?(log_path)\n ::Process.exec(\"tail #{opts.join(' ')} #{log_path}\", shell: true)\nelse\n raise(Error.new(\"No file found at #{log_path}\"))\nend\n"}}]},{"html_id":"procodile/Procodile/CLI/ReloadCommand","path":"Procodile/CLI/ReloadCommand.html","kind":"module","full_name":"Procodile::CLI::ReloadCommand","name":"ReloadCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/reload_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/commands/reload_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/reload_command.cr#L9"},"def":{"name":"reload","visibility":"Public","body":"if supervisor_running?\n ControlClient.run(@config.sock_path, \"reload_config\")\n puts(\"Reloaded Procodile config\")\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RestartCommand","path":"Procodile/CLI/RestartCommand.html","kind":"module","full_name":"Procodile::CLI::RestartCommand","name":"RestartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/restart_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"restart-instance-method","name":"restart","abstract":false,"location":{"filename":"src/procodile/commands/restart_command.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/restart_command.cr#L16"},"def":{"name":"restart","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"restart\", processes: process_names_from_cli_option, tag: @options.tag)).as(Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)))\n if instances.empty?\n puts(\"There are no processes to restart.\")\n else\n instances.each do |old_instance, new_instance|\n if old_instance && new_instance\n if old_instance.description == new_instance.description\n puts((\"Restarted\".color(35)) + \" #{old_instance.description}\")\n else\n puts((\"Restarted\".color(35)) + \" #{old_instance.description} -> #{new_instance.description}\")\n end\n else\n if old_instance\n puts((\"Stopped\".color(31)) + \" #{old_instance.description}\")\n else\n if new_instance\n puts((\"Started\".color(32)) + \" #{new_instance.description}\")\n end\n end\n end\n STDOUT.flush\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]},{"html_id":"procodile/Procodile/CLI/RunCommand","path":"Procodile/CLI/RunCommand.html","kind":"module","full_name":"Procodile::CLI::RunCommand","name":"RunCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/run_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"run(command=nil)-instance-method","name":"run","abstract":false,"args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"args_string":"(command = nil)","args_html":"(command = nil)","location":{"filename":"src/procodile/commands/run_command.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/run_command.cr#L9"},"def":{"name":"run","args":[{"name":"command","default_value":"nil","external_name":"command","restriction":""}],"visibility":"Public","body":"exec(command)"}}]},{"html_id":"procodile/Procodile/CLI/StartCommand","path":"Procodile/CLI/StartCommand.html","kind":"module","full_name":"Procodile::CLI::StartCommand","name":"StartCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/start_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/commands/start_command.cr","line_number":59,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/start_command.cr#L59"},"def":{"name":"start","visibility":"Public","body":"if supervisor_running?\n if @options.foreground\n raise(Error.new(\"Cannot be started in the foreground because supervisor already running\"))\n end\n if @options.respawn\n raise(Error.new(\"Cannot disable respawning because supervisor is already running\"))\n end\n if @options.stop_when_none\n raise(Error.new(\"Cannot stop supervisor when none running because supervisor is already running\"))\n end\n if @options.proxy\n raise(Error.new(\"Cannot enable the proxy when the supervisor is running\"))\n end\n instances = (ControlClient.run(@config.sock_path, \"start_processes\", processes: process_names_from_cli_option, tag: @options.tag, port_allocations: @options.port_allocations)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes to start.\")\n else\n instances.each do |instance|\n puts((\"Started\".color(32)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\nelse\n if @options.start_supervisor == false\n raise(Error.new(\"Supervisor is not running and cannot be started because --no-supervisor is set\"))\n else\n self.class.start_supervisor(@config, @options) do |supervisor|\n if @options.start_processes == false\n else\n supervisor.start_processes(process_names_from_cli_option, SupervisorOptions.new(tag: @options.tag))\n end\n end\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StatusCommand","path":"Procodile/CLI/StatusCommand.html","kind":"module","full_name":"Procodile::CLI::StatusCommand","name":"StatusCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/status_command.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"status-instance-method","name":"status","abstract":false,"location":{"filename":"src/procodile/commands/status_command.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/status_command.cr#L23"},"def":{"name":"status","visibility":"Public","body":"if supervisor_running?\n status = (ControlClient.run(@config.sock_path, \"status\")).as(ControlClientReplyForStatusCommand)\n if @options.json\n puts(status.to_json)\n else\n if @options.json_pretty\n puts(status)\n nil\n else\n if @options.simple\n if status.messages.empty?\n message = status.instances.map do |p, i|\n \"#{p}[#{i.size}]\"\n end\n puts(\"OK || #{message.join(\", \")}\")\n else\n message = status.messages.map do |p|\n Message.parse(p)\n end.join(\", \")\n puts(\"Issues || #{message}\")\n end\n else\n (StatusCLIOutput.new(status)).print_all\n end\n end\n end\nelse\n if @options.simple\n puts(\"NotRunning || Procodile supervisor isn't running\")\n else\n raise(Error.new(\"Procodile supervisor isn't running\"))\n end\nend"}}]},{"html_id":"procodile/Procodile/CLI/StopCommand","path":"Procodile/CLI/StopCommand.html","kind":"module","full_name":"Procodile::CLI::StopCommand","name":"StopCommand","abstract":false,"locations":[{"filename":"src/procodile/commands/stop_command.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L3"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"including_types":[{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"}],"namespace":{"html_id":"procodile/Procodile/CLI","kind":"class","full_name":"Procodile::CLI","name":"CLI"},"instance_methods":[{"html_id":"stop-instance-method","name":"stop","abstract":false,"location":{"filename":"src/procodile/commands/stop_command.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/commands/stop_command.cr#L20"},"def":{"name":"stop","visibility":"Public","body":"if supervisor_running?\n instances = (ControlClient.run(@config.sock_path, \"stop\", processes: process_names_from_cli_option, stop_supervisor: @options.stop_supervisor)).as(Array(InstanceConfig))\n if instances.empty?\n puts(\"No processes were stopped.\")\n else\n instances.each do |instance|\n puts((\"Stopped\".color(31)) + \" #{instance.description} (PID: #{instance.pid})\")\n end\n end\n if @options.stop_supervisor\n puts(\"Supervisor will be stopped when processes are stopped.\")\n end\n if @options.wait_until_supervisor_stopped\n puts(\"Waiting for supervisor to stop...\")\n loop do\n sleep(1)\n if supervisor_running?\n sleep(1)\n else\n puts(\"Supervisor has stopped\")\n exit(0)\n end\n end\n end\nelse\n raise(Error.new(\"Procodile supervisor isn't running\"))\nend"}}]}]},{"html_id":"procodile/Procodile/CliCommand","path":"Procodile/CliCommand.html","kind":"struct","full_name":"Procodile::CliCommand","name":"CliCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,description:String|Nil,options:Proc(OptionParser,Procodile::CLI,Nil)|Nil,callable:Proc(Nil))-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"args_string":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","args_html":"(name : String, description : String | Nil, options : Proc(OptionParser, Procodile::CLI, Nil) | Nil, callable : Proc(Nil))","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"description","external_name":"description","restriction":"String | ::Nil"},{"name":"options","external_name":"options","restriction":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil"},{"name":"callable","external_name":"callable","restriction":"Proc(Nil)"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, description, options, callable)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"callable:Proc(Nil)-instance-method","name":"callable","abstract":false,"def":{"name":"callable","return_type":"Proc(Nil)","visibility":"Public","body":"@callable"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @description.clone, @options.clone, @callable.clone)"}},{"html_id":"copy_with(name_name=@name,description_description=@description,options_options=@options,callable_callable=@callable)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"args_string":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","args_html":"(name _name = @name, description _description = @description, options _options = @options, callable _callable = @callable)","location":{"filename":"src/procodile/procfile_option.cr","line_number":64,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L64"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_options","default_value":"@options","external_name":"options","restriction":""},{"name":"_callable","default_value":"@callable","external_name":"callable","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _description, _options, _callable)"}},{"html_id":"description:String|Nil-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String | ::Nil","visibility":"Public","body":"@description"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"options:Proc(OptionParser,Procodile::CLI,Nil)|Nil-instance-method","name":"options","abstract":false,"def":{"name":"options","return_type":"Proc(OptionParser, Procodile::CLI, Nil) | ::Nil","visibility":"Public","body":"@options"}}]},{"html_id":"procodile/Procodile/CliOptions","path":"Procodile/CliOptions.html","kind":"struct","full_name":"Procodile::CliOptions","name":"CliOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":70,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L70"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":92,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L92"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clean:Bool|Nil-instance-method","name":"clean","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean","return_type":"Bool | ::Nil","visibility":"Public","body":"@clean"}},{"html_id":"clean=(clean:Bool|Nil)-instance-method","name":"clean=","abstract":false,"args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"args_string":"(clean : Bool | Nil)","args_html":"(clean : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L86"},"def":{"name":"clean=","args":[{"name":"clean","external_name":"clean","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@clean = clean"}},{"html_id":"development:Bool|Nil-instance-method","name":"development","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L87"},"def":{"name":"development","return_type":"Bool | ::Nil","visibility":"Public","body":"@development"}},{"html_id":"development=(development:Bool|Nil)-instance-method","name":"development=","abstract":false,"args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"args_string":"(development : Bool | Nil)","args_html":"(development : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":87,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L87"},"def":{"name":"development=","args":[{"name":"development","external_name":"development","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@development = development"}},{"html_id":"foreground:Bool|Nil-instance-method","name":"foreground","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground","return_type":"Bool | ::Nil","visibility":"Public","body":"@foreground"}},{"html_id":"foreground=(foreground:Bool|Nil)-instance-method","name":"foreground=","abstract":false,"args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"args_string":"(foreground : Bool | Nil)","args_html":"(foreground : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L71"},"def":{"name":"foreground=","args":[{"name":"foreground","external_name":"foreground","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@foreground = foreground"}},{"html_id":"json:Bool|Nil-instance-method","name":"json","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L82"},"def":{"name":"json","return_type":"Bool | ::Nil","visibility":"Public","body":"@json"}},{"html_id":"json=(json:Bool|Nil)-instance-method","name":"json=","abstract":false,"args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"args_string":"(json : Bool | Nil)","args_html":"(json : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":82,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L82"},"def":{"name":"json=","args":[{"name":"json","external_name":"json","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json = json"}},{"html_id":"json_pretty:Bool|Nil-instance-method","name":"json_pretty","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty","return_type":"Bool | ::Nil","visibility":"Public","body":"@json_pretty"}},{"html_id":"json_pretty=(json_pretty:Bool|Nil)-instance-method","name":"json_pretty=","abstract":false,"args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"args_string":"(json_pretty : Bool | Nil)","args_html":"(json_pretty : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":83,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L83"},"def":{"name":"json_pretty=","args":[{"name":"json_pretty","external_name":"json_pretty","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@json_pretty = json_pretty"}},{"html_id":"lines:Int32|Nil-instance-method","name":"lines","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines","return_type":"Int32 | ::Nil","visibility":"Public","body":"@lines"}},{"html_id":"lines=(lines:Int32|Nil)-instance-method","name":"lines=","abstract":false,"args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"args_string":"(lines : Int32 | Nil)","args_html":"(lines : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":89,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L89"},"def":{"name":"lines=","args":[{"name":"lines","external_name":"lines","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@lines = lines"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":76,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L76"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L90"},"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"process=(process:String|Nil)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"args_string":"(process : String | Nil)","args_html":"(process : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":90,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L90"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"String | ::Nil"}],"visibility":"Public","body":"@process = process"}},{"html_id":"processes:String|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes","return_type":"String | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:String|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"args_string":"(processes : String | Nil)","args_html":"(processes : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":85,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L85"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"String | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":74,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L74"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"reload=(reload:Bool|Nil)-instance-method","name":"reload=","abstract":false,"args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(reload : Bool | Nil)","args_html":"(reload : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":81,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L81"},"def":{"name":"reload=","args":[{"name":"reload","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@reload = reload"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":72,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L72"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"simple:Bool|Nil-instance-method","name":"simple","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple","return_type":"Bool | ::Nil","visibility":"Public","body":"@simple"}},{"html_id":"simple=(simple:Bool|Nil)-instance-method","name":"simple=","abstract":false,"args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"args_string":"(simple : Bool | Nil)","args_html":"(simple : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":84,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L84"},"def":{"name":"simple=","args":[{"name":"simple","external_name":"simple","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@simple = simple"}},{"html_id":"start_processes:Bool|Nil-instance-method","name":"start_processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_processes"}},{"html_id":"start_processes=(start_processes:Bool|Nil)-instance-method","name":"start_processes=","abstract":false,"args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"args_string":"(start_processes : Bool | Nil)","args_html":"(start_processes : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L78"},"def":{"name":"start_processes=","args":[{"name":"start_processes","external_name":"start_processes","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_processes = start_processes"}},{"html_id":"start_supervisor:Bool|Nil-instance-method","name":"start_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@start_supervisor"}},{"html_id":"start_supervisor=(start_supervisor:Bool|Nil)-instance-method","name":"start_supervisor=","abstract":false,"args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(start_supervisor : Bool | Nil)","args_html":"(start_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L77"},"def":{"name":"start_supervisor=","args":[{"name":"start_supervisor","external_name":"start_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@start_supervisor = start_supervisor"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"stop_supervisor=(stop_supervisor:Bool|Nil)-instance-method","name":"stop_supervisor=","abstract":false,"args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(stop_supervisor : Bool | Nil)","args_html":"(stop_supervisor : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":79,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L79"},"def":{"name":"stop_supervisor=","args":[{"name":"stop_supervisor","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_supervisor = stop_supervisor"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":73,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L73"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}},{"html_id":"tag=(tag:String|Nil)-instance-method","name":"tag=","abstract":false,"args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"args_string":"(tag : String | Nil)","args_html":"(tag : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":75,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L75"},"def":{"name":"tag=","args":[{"name":"tag","external_name":"tag","restriction":"String | ::Nil"}],"visibility":"Public","body":"@tag = tag"}},{"html_id":"wait:Bool|Nil-instance-method","name":"wait","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait"}},{"html_id":"wait=(wait:Bool|Nil)-instance-method","name":"wait=","abstract":false,"args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"args_string":"(wait : Bool | Nil)","args_html":"(wait : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L88"},"def":{"name":"wait=","args":[{"name":"wait","external_name":"wait","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait = wait"}},{"html_id":"wait_until_supervisor_stopped:Bool|Nil-instance-method","name":"wait_until_supervisor_stopped","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped","return_type":"Bool | ::Nil","visibility":"Public","body":"@wait_until_supervisor_stopped"}},{"html_id":"wait_until_supervisor_stopped=(wait_until_supervisor_stopped:Bool|Nil)-instance-method","name":"wait_until_supervisor_stopped=","abstract":false,"args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"args_string":"(wait_until_supervisor_stopped : Bool | Nil)","args_html":"(wait_until_supervisor_stopped : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L80"},"def":{"name":"wait_until_supervisor_stopped=","args":[{"name":"wait_until_supervisor_stopped","external_name":"wait_until_supervisor_stopped","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@wait_until_supervisor_stopped = wait_until_supervisor_stopped"}}]},{"html_id":"procodile/Procodile/Config","path":"Procodile/Config.html","kind":"class","full_name":"Procodile::Config","name":"Config","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/config.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"COLORS","name":"COLORS","value":"[35, 31, 36, 32, 33, 34]","doc":"35 紫,31 红,36 青,32 绿,33 橘,34 蓝","summary":"

35 紫,31 红,36 青,32 绿,33 橘,34 蓝

"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(root:String,procfile:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(root : String, procfile : String | Nil = nil)","args_html":"(root : String, procfile : String | Nil = nil)","location":{"filename":"src/procodile/config.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L20"},"def":{"name":"new","args":[{"name":"root","external_name":"root","restriction":"String"},{"name":"procfile","default_value":"nil","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(root, procfile)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":95,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L95"},"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name || (@app_name = (local_options.app_name || options.app_name) || \"Procodile\")"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":99,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L99"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"local_options.console_command || options.console_command"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L138"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"option_env = options.env || ({} of String => String)\nlocal_option_env = local_options.env || ({} of String => String)\noption_env.merge(local_option_env)\n"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":103,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L103"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"local_options.exec_prefix || options.exec_prefix"}},{"html_id":"loaded_at:Time?-instance-method","name":"loaded_at","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L18"},"def":{"name":"loaded_at","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options:ProcfileOption-instance-method","name":"local_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":119,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L119"},"def":{"name":"local_options","return_type":"ProcfileOption","visibility":"Public","body":"@local_options || (@local_options = load_local_options_from_file)"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":182,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L182"},"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.local\""}},{"html_id":"local_process_options:Hash(String,ProcessOption)-instance-method","name":"local_process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":127,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L127"},"def":{"name":"local_process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@local_process_options || (@local_process_options = local_options.processes || ({} of String => ProcessOption))"}},{"html_id":"log_path:String-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L152"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = local_options.log_path || options.log_path\nif log_path\n File.expand_path(log_path, self.root)\nelse\n if log_path.nil? && self.log_root\n File.join(self.log_root.not_nil!, \"procodile.log\")\n else\n File.expand_path(\"procodile.log\", self.root)\n end\nend\n"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":164,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L164"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"log_root = local_options.log_root || options.log_root\nif log_root\n File.expand_path(log_root, self.root)\nend\n"}},{"html_id":"options:ProcfileOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":115,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L115"},"def":{"name":"options","return_type":"ProcfileOption","visibility":"Public","body":"@options || (@options = load_options_from_file)"}},{"html_id":"options_for_process(name):ProcessOption-instance-method","name":"options_for_process","abstract":false,"args":[{"name":"name","external_name":"name","restriction":""}],"args_string":"(name) : ProcessOption","args_html":"(name) : ProcessOption","location":{"filename":"src/procodile/config.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L131"},"def":{"name":"options_for_process","args":[{"name":"name","external_name":"name","restriction":""}],"return_type":"ProcessOption","visibility":"Public","body":"po = process_options[name]? || ProcessOption.new\nlocal_po = local_process_options[name]? || ProcessOption.new\npo.merge(local_po)\n"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":178,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L178"},"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"\"#{procfile_path}.options\""}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":144,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L144"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"File.expand_path((local_options.pid_root || options.pid_root) || \"pids\", self.root)"}},{"html_id":"process_list:Hash(String,String)-instance-method","name":"process_list","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":111,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L111"},"def":{"name":"process_list","return_type":"Hash(String, String)","visibility":"Public","body":"@process_list || (@process_list = load_process_list_from_file)"}},{"html_id":"process_options:Hash(String,ProcessOption)-instance-method","name":"process_options","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":123,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L123"},"def":{"name":"process_options","return_type":"Hash(String, ProcessOption)","visibility":"Public","body":"@process_options || (@process_options = options.processes || ({} of String => ProcessOption))"}},{"html_id":"processes:Hash(String,Procodile::Process)-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L107"},"def":{"name":"processes","return_type":"Hash(String, Procodile::Process)","visibility":"Public","body":"@processes || (@processes = {} of String => Procodile::Process)"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":174,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L174"},"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path || (File.join(self.root, \"Procfile\"))"}},{"html_id":"reload-instance-method","name":"reload","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":47,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L47"},"def":{"name":"reload","visibility":"Public","body":"@process_list = nil\n@options = nil\n@local_options = nil\n@process_options = nil\n@local_process_options = nil\n@loaded_at = nil\n@environment_variables = nil\nif (processes = @processes)\n process_list.each do |name, command|\n if ( process = processes[name]?)\n process.removed = false\n if process.command != command\n process.command = command\n Procodile.log(nil, \"system\", \"#{name} command has changed. Updated.\")\n end\n process.options = options_for_process(name)\n else\n Procodile.log(nil, \"system\", \"#{name} has been added to the Procfile.\")\n processes[name] = create_process(name, command, COLORS[(processes.size.divmod(COLORS.size))[1]])\n end\n end\n removed_processes = processes.keys - process_list.keys\n removed_processes.each do |process_name|\n if ( p = (processes[process_name]))\n p.removed = true\n processes.delete(process_name)\n Procodile.log(nil, \"system\", \"#{process_name} has been removed in the Procfile. It will be removed when it is stopped.\")\n end\n end\nend\n@loaded_at = Time.local\n"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L18"},"def":{"name":"root","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L170"},"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.sock\")"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":148,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L148"},"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"File.join(pid_root, \"procodile.pid\")"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/config.cr","line_number":91,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/config.cr#L91"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"local_options.user || options.user"}}]},{"html_id":"procodile/Procodile/ControlClient","path":"Procodile/ControlClient.html","kind":"class","full_name":"Procodile::ControlClient","name":"ControlClient","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_client.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"run(sock_path:String,command:String,**options)-class-method","name":"run","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"args_string":"(sock_path : String, command : String, **options)","args_html":"(sock_path : String, command : String, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L18"},"def":{"name":"run","args":[{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"command","external_name":"command","restriction":"String"}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"begin\n socket = self.new(sock_path)\n socket.run(command, **options)\nensure\n socket.try(&.disconnect)\nend"}}],"constructors":[{"html_id":"new(sock_path,block:Proc(ControlClient,Nil)|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"args_string":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","args_html":"(sock_path, block : Proc(ControlClient, Nil) | Nil = nil)","location":{"filename":"src/procodile/control_client.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L6"},"def":{"name":"new","args":[{"name":"sock_path","external_name":"sock_path","restriction":""},{"name":"block","default_value":"nil","external_name":"block","restriction":"Proc(ControlClient, Nil) | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(sock_path, block)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"disconnect-instance-method","name":"disconnect","abstract":false,"location":{"filename":"src/procodile/control_client.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L53"},"def":{"name":"disconnect","visibility":"Public","body":"@socket.try(&.close)"}},{"html_id":"run(command,**options)-instance-method","name":"run","abstract":false,"args":[{"name":"command","external_name":"command","restriction":""}],"args_string":"(command, **options)","args_html":"(command, **options)","location":{"filename":"src/procodile/control_client.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_client.cr#L25"},"def":{"name":"run","args":[{"name":"command","external_name":"command","restriction":""}],"double_splat":{"name":"options","external_name":"options","restriction":""},"visibility":"Public","body":"@socket.puts(\"#{command} #{options.to_json}\")\nif (data = @socket.gets)\n code, reply = data.strip.split(/\\s+/, 2)\n if code.to_i == 200\n if reply && (!reply.empty?)\n case command\n when \"start_processes\", \"stop\"\n Array(InstanceConfig).from_json(reply)\n when \"restart\"\n Array(Tuple(InstanceConfig | ::Nil, InstanceConfig | ::Nil)).from_json(reply)\n when \"check_concurrency\"\n NamedTuple(started: Array(InstanceConfig), stopped: Array(InstanceConfig)).from_json(reply)\n when \"status\"\n ControlClientReplyForStatusCommand.from_json(reply)\n end\n else\n true\n end\n else\n raise(Error.new(\"Error from control server: #{code} (#{reply.inspect})\"))\n end\nelse\n raise(Error.new(\"Control server disconnected.\"))\nend\n"}}]},{"html_id":"procodile/Procodile/ControlClientProcessStatus","path":"Procodile/ControlClientProcessStatus.html","kind":"struct","full_name":"Procodile::ControlClientProcessStatus","name":"ControlClientProcessStatus","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(name:String,log_color:Int32,quantity:Int32,max_respawns:Int32,respawn_window:Int32,command:String,restart_mode:Signal|String|Nil,log_path:String|Nil,removed:Bool,proxy_port:Int32|Nil,proxy_address:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","args_html":"(name : String, log_color : Int32, quantity : Int32, max_respawns : Int32, respawn_window : Int32, command : String, restart_mode : Signal | String | Nil, log_path : String | Nil, removed : Bool, proxy_port : Int32 | Nil, proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"new","args":[{"name":"name","external_name":"name","restriction":"String"},{"name":"log_color","external_name":"log_color","restriction":"Int32"},{"name":"quantity","external_name":"quantity","restriction":"Int32"},{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32"},{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32"},{"name":"command","external_name":"command","restriction":"String"},{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"},{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"},{"name":"removed","external_name":"removed","restriction":"Bool"},{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"},{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(name, log_color, quantity, max_respawns, respawn_window, command, restart_mode, log_path, removed, proxy_port, proxy_address)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":137,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L137"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@name.clone, @log_color.clone, @quantity.clone, @max_respawns.clone, @respawn_window.clone, @command.clone, @restart_mode.clone, @log_path.clone, @removed.clone, @proxy_port.clone, @proxy_address.clone)"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"def":{"name":"command","return_type":"String","visibility":"Public","body":"@command"}},{"html_id":"copy_with(name_name=@name,log_color_log_color=@log_color,quantity_quantity=@quantity,max_respawns_max_respawns=@max_respawns,respawn_window_respawn_window=@respawn_window,command_command=@command,restart_mode_restart_mode=@restart_mode,log_path_log_path=@log_path,removed_removed=@removed,proxy_port_proxy_port=@proxy_port,proxy_address_proxy_address=@proxy_address)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"args_string":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","args_html":"(name _name = @name, log_color _log_color = @log_color, quantity _quantity = @quantity, max_respawns _max_respawns = @max_respawns, respawn_window _respawn_window = @respawn_window, command _command = @command, restart_mode _restart_mode = @restart_mode, log_path _log_path = @log_path, removed _removed = @removed, proxy_port _proxy_port = @proxy_port, proxy_address _proxy_address = @proxy_address)","location":{"filename":"src/procodile/procfile_option.cr","line_number":125,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L125"},"def":{"name":"copy_with","args":[{"name":"_name","default_value":"@name","external_name":"name","restriction":""},{"name":"_log_color","default_value":"@log_color","external_name":"log_color","restriction":""},{"name":"_quantity","default_value":"@quantity","external_name":"quantity","restriction":""},{"name":"_max_respawns","default_value":"@max_respawns","external_name":"max_respawns","restriction":""},{"name":"_respawn_window","default_value":"@respawn_window","external_name":"respawn_window","restriction":""},{"name":"_command","default_value":"@command","external_name":"command","restriction":""},{"name":"_restart_mode","default_value":"@restart_mode","external_name":"restart_mode","restriction":""},{"name":"_log_path","default_value":"@log_path","external_name":"log_path","restriction":""},{"name":"_removed","default_value":"@removed","external_name":"removed","restriction":""},{"name":"_proxy_port","default_value":"@proxy_port","external_name":"proxy_port","restriction":""},{"name":"_proxy_address","default_value":"@proxy_address","external_name":"proxy_address","restriction":""}],"visibility":"Public","body":"self.class.new(_name, _log_color, _quantity, _max_respawns, _respawn_window, _command, _restart_mode, _log_path, _removed, _proxy_port, _proxy_address)"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"def":{"name":"log_color","return_type":"Int32","visibility":"Public","body":"@log_color"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","abstract":false,"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@max_respawns"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"def":{"name":"name","return_type":"String","visibility":"Public","body":"@name"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","abstract":false,"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@quantity"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"def":{"name":"removed","return_type":"Bool","visibility":"Public","body":"@removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","abstract":false,"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}}]},{"html_id":"procodile/Procodile/ControlClientReplyForStatusCommand","path":"Procodile/ControlClientReplyForStatusCommand.html","kind":"struct","full_name":"Procodile::ControlClientReplyForStatusCommand","name":"ControlClientReplyForStatusCommand","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(version:String,messages:Array(SupervisorMessages),root:String,app_name:String,supervisor:NamedTuple(started_at:Int64,pid:Int64),instances:Hash(String,Array(InstanceConfig)),processes:Array(ControlClientProcessStatus),environment_variables:Hash(String,String),procfile_path:String,options_path:String,local_options_path:String,sock_path:String,supervisor_pid_path:String,pid_root:String,loaded_at:Int64,log_root:String|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","args_html":"(version : String, messages : Array(SupervisorMessages), root : String, app_name : String, supervisor : NamedTuple(started_at: Int64, pid: Int64), instances : Hash(String, Array(InstanceConfig)), processes : Array(ControlClientProcessStatus), environment_variables : Hash(String, String), procfile_path : String, options_path : String, local_options_path : String, sock_path : String, supervisor_pid_path : String, pid_root : String, loaded_at : Int64, log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"new","args":[{"name":"version","external_name":"version","restriction":"String"},{"name":"messages","external_name":"messages","restriction":"Array(SupervisorMessages)"},{"name":"root","external_name":"root","restriction":"String"},{"name":"app_name","external_name":"app_name","restriction":"String"},{"name":"supervisor","external_name":"supervisor","restriction":"NamedTuple(started_at: Int64, pid: Int64)"},{"name":"instances","external_name":"instances","restriction":"Hash(String, Array(InstanceConfig))"},{"name":"processes","external_name":"processes","restriction":"Array(ControlClientProcessStatus)"},{"name":"environment_variables","external_name":"environment_variables","restriction":"Hash(String, String)"},{"name":"procfile_path","external_name":"procfile_path","restriction":"String"},{"name":"options_path","external_name":"options_path","restriction":"String"},{"name":"local_options_path","external_name":"local_options_path","restriction":"String"},{"name":"sock_path","external_name":"sock_path","restriction":"String"},{"name":"supervisor_pid_path","external_name":"supervisor_pid_path","restriction":"String"},{"name":"pid_root","external_name":"pid_root","restriction":"String"},{"name":"loaded_at","external_name":"loaded_at","restriction":"Int64"},{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(version, messages, root, app_name, supervisor, instances, processes, environment_variables, procfile_path, options_path, local_options_path, sock_path, supervisor_pid_path, pid_root, loaded_at, log_root)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":167,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L167"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"app_name:String-instance-method","name":"app_name","abstract":false,"def":{"name":"app_name","return_type":"String","visibility":"Public","body":"@app_name"}},{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@version.clone, @messages.clone, @root.clone, @app_name.clone, @supervisor.clone, @instances.clone, @processes.clone, @environment_variables.clone, @procfile_path.clone, @options_path.clone, @local_options_path.clone, @sock_path.clone, @supervisor_pid_path.clone, @pid_root.clone, @loaded_at.clone, @log_root.clone)"}},{"html_id":"copy_with(version_version=@version,messages_messages=@messages,root_root=@root,app_name_app_name=@app_name,supervisor_supervisor=@supervisor,instances_instances=@instances,processes_processes=@processes,environment_variables_environment_variables=@environment_variables,procfile_path_procfile_path=@procfile_path,options_path_options_path=@options_path,local_options_path_local_options_path=@local_options_path,sock_path_sock_path=@sock_path,supervisor_pid_path_supervisor_pid_path=@supervisor_pid_path,pid_root_pid_root=@pid_root,loaded_at_loaded_at=@loaded_at,log_root_log_root=@log_root)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"args_string":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","args_html":"(version _version = @version, messages _messages = @messages, root _root = @root, app_name _app_name = @app_name, supervisor _supervisor = @supervisor, instances _instances = @instances, processes _processes = @processes, environment_variables _environment_variables = @environment_variables, procfile_path _procfile_path = @procfile_path, options_path _options_path = @options_path, local_options_path _local_options_path = @local_options_path, sock_path _sock_path = @sock_path, supervisor_pid_path _supervisor_pid_path = @supervisor_pid_path, pid_root _pid_root = @pid_root, loaded_at _loaded_at = @loaded_at, log_root _log_root = @log_root)","location":{"filename":"src/procodile/procfile_option.cr","line_number":150,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L150"},"def":{"name":"copy_with","args":[{"name":"_version","default_value":"@version","external_name":"version","restriction":""},{"name":"_messages","default_value":"@messages","external_name":"messages","restriction":""},{"name":"_root","default_value":"@root","external_name":"root","restriction":""},{"name":"_app_name","default_value":"@app_name","external_name":"app_name","restriction":""},{"name":"_supervisor","default_value":"@supervisor","external_name":"supervisor","restriction":""},{"name":"_instances","default_value":"@instances","external_name":"instances","restriction":""},{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_environment_variables","default_value":"@environment_variables","external_name":"environment_variables","restriction":""},{"name":"_procfile_path","default_value":"@procfile_path","external_name":"procfile_path","restriction":""},{"name":"_options_path","default_value":"@options_path","external_name":"options_path","restriction":""},{"name":"_local_options_path","default_value":"@local_options_path","external_name":"local_options_path","restriction":""},{"name":"_sock_path","default_value":"@sock_path","external_name":"sock_path","restriction":""},{"name":"_supervisor_pid_path","default_value":"@supervisor_pid_path","external_name":"supervisor_pid_path","restriction":""},{"name":"_pid_root","default_value":"@pid_root","external_name":"pid_root","restriction":""},{"name":"_loaded_at","default_value":"@loaded_at","external_name":"loaded_at","restriction":""},{"name":"_log_root","default_value":"@log_root","external_name":"log_root","restriction":""}],"visibility":"Public","body":"self.class.new(_version, _messages, _root, _app_name, _supervisor, _instances, _processes, _environment_variables, _procfile_path, _options_path, _local_options_path, _sock_path, _supervisor_pid_path, _pid_root, _loaded_at, _log_root)"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","abstract":false,"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"@environment_variables"}},{"html_id":"instances:Hash(String,Array(InstanceConfig))-instance-method","name":"instances","abstract":false,"def":{"name":"instances","return_type":"Hash(String, Array(InstanceConfig))","visibility":"Public","body":"@instances"}},{"html_id":"loaded_at:Int64-instance-method","name":"loaded_at","abstract":false,"def":{"name":"loaded_at","return_type":"Int64","visibility":"Public","body":"@loaded_at"}},{"html_id":"local_options_path:String-instance-method","name":"local_options_path","abstract":false,"def":{"name":"local_options_path","return_type":"String","visibility":"Public","body":"@local_options_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"@messages"}},{"html_id":"options_path:String-instance-method","name":"options_path","abstract":false,"def":{"name":"options_path","return_type":"String","visibility":"Public","body":"@options_path"}},{"html_id":"pid_root:String-instance-method","name":"pid_root","abstract":false,"def":{"name":"pid_root","return_type":"String","visibility":"Public","body":"@pid_root"}},{"html_id":"processes:Array(ControlClientProcessStatus)-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(ControlClientProcessStatus)","visibility":"Public","body":"@processes"}},{"html_id":"procfile_path:String-instance-method","name":"procfile_path","abstract":false,"def":{"name":"procfile_path","return_type":"String","visibility":"Public","body":"@procfile_path"}},{"html_id":"root:String-instance-method","name":"root","abstract":false,"def":{"name":"root","return_type":"String","visibility":"Public","body":"@root"}},{"html_id":"sock_path:String-instance-method","name":"sock_path","abstract":false,"def":{"name":"sock_path","return_type":"String","visibility":"Public","body":"@sock_path"}},{"html_id":"supervisor:NamedTuple(started_at:Int64,pid:Int64)-instance-method","name":"supervisor","abstract":false,"def":{"name":"supervisor","return_type":"NamedTuple(started_at: Int64, pid: Int64)","visibility":"Public","body":"@supervisor"}},{"html_id":"supervisor_pid_path:String-instance-method","name":"supervisor_pid_path","abstract":false,"def":{"name":"supervisor_pid_path","return_type":"String","visibility":"Public","body":"@supervisor_pid_path"}},{"html_id":"version:String-instance-method","name":"version","abstract":false,"def":{"name":"version","return_type":"String","visibility":"Public","body":"@version"}}]},{"html_id":"procodile/Procodile/ControlServer","path":"Procodile/ControlServer.html","kind":"class","full_name":"Procodile::ControlServer","name":"ControlServer","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_server.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/control_server.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_server.cr#L6"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"begin\n sock_path = supervisor.config.sock_path\n spawn do\n server = UNIXServer.new(sock_path)\n Procodile.log(nil, \"control\", \"Listening at #{sock_path}\")\n loop do\n client = server.accept\n session = ControlSession.new(supervisor, client)\n while ( line = client.gets)\n if ( response = session.receive_data(line.strip))\n client.puts(response)\n end\n end\n client.close\n end\n end\nensure\n FileUtils.rm_rf(sock_path.not_nil!)\nend"}}]},{"html_id":"procodile/Procodile/ControlSession","path":"Procodile/ControlSession.html","kind":"class","full_name":"Procodile::ControlSession","name":"ControlSession","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/control_session.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L5"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,client:UNIXSocket)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"args_string":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","args_html":"(supervisor : Procodile::Supervisor, client : UNIXSocket)","location":{"filename":"src/procodile/control_session.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L6"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"},{"name":"client","external_name":"client","restriction":"UNIXSocket"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, client)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"check_concurrency(options):String-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L55"},"def":{"name":"check_concurrency","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"result = @supervisor.check_concurrency(SupervisorOptions.new(reload: options.reload))\nresult = result.transform_values do |instances|\n instances.map(&.to_hash)\nend\n\"200 #{result.to_json}\"\n"}},{"html_id":"receive_data(data)-instance-method","name":"receive_data","abstract":false,"args":[{"name":"data","external_name":"data","restriction":""}],"args_string":"(data)","args_html":"(data)","location":{"filename":"src/procodile/control_session.cr","line_number":100,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L100"},"def":{"name":"receive_data","args":[{"name":"data","external_name":"data","restriction":""}],"visibility":"Public","body":"command, _options = data.split(/\\s+/, 2)\noptions = ControlSessionData.from_json(_options)\ncallable = {} of String => Proc(ControlSessionData, String)\ncallable[\"start_processes\"] = ->start_processes(ControlSessionData)\ncallable[\"stop\"] = ->stop(ControlSessionData)\ncallable[\"restart\"] = ->restart(ControlSessionData)\ncallable[\"reload_config\"] = ->reload_config(ControlSessionData)\ncallable[\"check_concurrency\"] = ->check_concurrency(ControlSessionData)\ncallable[\"status\"] = ->status(ControlSessionData)\nif callable[command]?\n begin\n callable[command].call(options)\n rescue e : Procodile::Error\n Procodile.log(nil, \"control\", \"Error: #{e.message}\".color(31))\n \"500 #{e.message}\"\n end\nelse\n \"404 Invaid command\"\nend\n"}},{"html_id":"reload_config(options):String-instance-method","name":"reload_config","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L49"},"def":{"name":"reload_config","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"@supervisor.reload_config\n\"200 []\"\n"}},{"html_id":"restart(options):String-instance-method","name":"restart","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":38,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L38"},"def":{"name":"restart","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.restart(SupervisorOptions.new(processes: options.processes, tag: options.tag))\n\"200 \" + instances.map do |a|\n a.map do |i|\n i ? i.to_hash : nil\n end\nend.to_json\n"}},{"html_id":"start_processes(options):String-instance-method","name":"start_processes","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L9"},"def":{"name":"start_processes","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"if options.port_allocations\n run_options_port_allocations = @supervisor.run_options.port_allocations\n if run_options_port_allocations\n run_options_port_allocations.merge!(options.port_allocations.not_nil!)\n else\n @supervisor.run_options.port_allocations = options.port_allocations\n end\nend\ninstances = @supervisor.start_processes(options.processes, SupervisorOptions.new(tag: options.tag))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}},{"html_id":"status(options):String-instance-method","name":"status","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":66,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L66"},"def":{"name":"status","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = {} of String => Array(Procodile::InstanceConfig)\n@supervisor.processes.each do |process, process_instances|\n instances[process.name] = [] of Procodile::InstanceConfig\n process_instances.each do |instance|\n instances[process.name] << instance.to_hash\n end\nend\nprocesses = @supervisor.processes.keys.map(&.to_hash)\nresult = ControlClientReplyForStatusCommand.new(version: Procodile::VERSION, messages: @supervisor.messages, root: @supervisor.config.root, app_name: @supervisor.config.app_name, supervisor: @supervisor.to_hash, instances: instances, processes: processes, environment_variables: @supervisor.config.environment_variables, procfile_path: @supervisor.config.procfile_path, options_path: @supervisor.config.options_path, local_options_path: @supervisor.config.local_options_path, sock_path: @supervisor.config.sock_path, log_root: @supervisor.config.log_root, supervisor_pid_path: @supervisor.config.supervisor_pid_path, pid_root: @supervisor.config.pid_root, loaded_at: @supervisor.config.loaded_at.not_nil!.to_unix)\n\"200 #{result.to_json}\"\n"}},{"html_id":"stop(options):String-instance-method","name":"stop","abstract":false,"args":[{"name":"options","external_name":"options","restriction":""}],"args_string":"(options) : String","args_html":"(options) : String","location":{"filename":"src/procodile/control_session.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/control_session.cr#L27"},"def":{"name":"stop","args":[{"name":"options","external_name":"options","restriction":""}],"return_type":"String","visibility":"Public","body":"instances = @supervisor.stop(SupervisorOptions.new(processes: options.processes, stop_supervisor: options.stop_supervisor))\n\"200 #{instances.map(&.to_hash).to_json}\"\n"}}]},{"html_id":"procodile/Procodile/ControlSessionData","path":"Procodile/ControlSessionData.html","kind":"struct","full_name":"Procodile::ControlSessionData","name":"ControlSessionData","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=[]ofString,tag:String|Nil=nil,port_allocations:Hash(String,Int32)|Nil=nil,reload:Bool|Nil=nil,stop_supervisor:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = [] of String, tag : String | Nil = nil, port_allocations : Hash(String, Int32) | Nil = nil, reload : Bool | Nil = nil, stop_supervisor : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"new","args":[{"name":"processes","default_value":"[] of String","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"port_allocations","default_value":"nil","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, tag, port_allocations, reload, stop_supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":102,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L102"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @tag.clone, @port_allocations.clone, @reload.clone, @stop_supervisor.clone)"}},{"html_id":"copy_with(processes_processes=@processes,tag_tag=@tag,port_allocations_port_allocations=@port_allocations,reload_reload=@reload,stop_supervisor_stop_supervisor=@stop_supervisor)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"args_string":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","args_html":"(processes _processes = @processes, tag _tag = @tag, port_allocations _port_allocations = @port_allocations, reload _reload = @reload, stop_supervisor _stop_supervisor = @stop_supervisor)","location":{"filename":"src/procodile/procfile_option.cr","line_number":96,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L96"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port_allocations","default_value":"@port_allocations","external_name":"port_allocations","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _tag, _port_allocations, _reload, _stop_supervisor)"}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Error","path":"Procodile/Error.html","kind":"class","full_name":"Procodile::Error","name":"Error","abstract":false,"superclass":{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"procodile/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/error.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/error.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"}},{"html_id":"procodile/Procodile/Instance","path":"Procodile/Instance.html","kind":"class","full_name":"Procodile::Instance","name":"Instance","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/instance.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor,process:Procodile::Process,id:Int32)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"args_string":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","args_html":"(supervisor : Procodile::Supervisor, process : Procodile::Process, id : Int32)","location":{"filename":"src/procodile/instance.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L17"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"::Procodile::Supervisor"},{"name":"process","external_name":"process","restriction":"::Procodile::Process"},{"name":"id","external_name":"id","restriction":"::Int32"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor, process, id)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_respawn:Int32-instance-method","name":"add_respawn","doc":"\nIncrement the counter of respawns for this process\n","summary":"

Increment the counter of respawns for this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":356,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L356"},"def":{"name":"add_respawn","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif last_respawn && last_respawn < (Time.local - @process.respawn_window.seconds)\n @respawns = 1\nelse\n @last_respawn = Time.local\n @respawns = @respawns + 1\nend\n"}},{"html_id":"allocate_port(max_attempts=10)-instance-method","name":"allocate_port","doc":"\nFind a port number for this instance to listen on. We just check that nothing is already listening on it.\nThe process is expected to take it straight away if it wants it.\n","summary":"

Find a port number for this instance to listen on.

","abstract":false,"args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"args_string":"(max_attempts = 10)","args_html":"(max_attempts = 10)","location":{"filename":"src/procodile/instance.cr","line_number":389,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L389"},"def":{"name":"allocate_port","args":[{"name":"max_attempts","default_value":"10","external_name":"max_attempts","restriction":""}],"visibility":"Public","body":"attempts = 0\nwhile !@port\n attempts = attempts + 1\n possible_port = rand(20000..29999)\n if self.port_available?(possible_port)\n Procodile.log(@process.log_color, description, \"Allocated port as #{possible_port}\")\n @port = possible_port\n else\n if attempts >= max_attempts\n raise(Procodile::Error.new(\"Couldn't allocate port for #{process.name}\"))\n end\n end\nend\n"}},{"html_id":"can_respawn?:Bool-instance-method","name":"can_respawn?","doc":"\nCan this process be respawned if needed?\n","summary":"

Can this process be respawned if needed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":336,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L336"},"def":{"name":"can_respawn?","return_type":"Bool","visibility":"Public","body":"(!stopping?) && (respawns + 1) <= @process.max_respawns"}},{"html_id":"check(options={}ofString=>String)-instance-method","name":"check","doc":"\nCheck the status of this process and handle as appropriate.\n","summary":"

Check the status of this process and handle as appropriate.

","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String)","args_html":"(options = {} of String => String)","location":{"filename":"src/procodile/instance.cr","line_number":303,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L303"},"def":{"name":"check","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"visibility":"Public","body":"if failed?\n return\nend\nif self.running?\n true\nelse\n if update_pid\n return check\n end\n if @supervisor.allow_respawning?\n if can_respawn?\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning...\")\n start\n add_respawn\n else\n if respawns >= @process.max_respawns\n Procodile.log(@process.log_color, description, \"\\e[41;37mWarning:\\e[0m\\e[31m this process has been respawned #{respawns} times and keeps dying.\\e[0m\")\n Procodile.log(@process.log_color, description, \"It will not be respawned automatically any longer and will no longer be managed.\".color(31))\n @failed = Time.local\n tidy\n end\n end\n else\n Procodile.log(@process.log_color, description, \"Process has stopped. Respawning not available.\")\n @failed = Time.local\n tidy\n end\nend\n"}},{"html_id":"description-instance-method","name":"description","doc":"\nReturn a description for this instance\n","summary":"

Return a description for this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":26,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L26"},"def":{"name":"description","visibility":"Public","body":"\"#{@process.name}.#{@id}\""}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn an array of environment variables that should be set\n","summary":"

Return an array of environment variables that should be set

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L57"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"vars = @process.environment_variables.merge({\"PROC_NAME\" => self.description, \"PID_FILE\" => self.pid_file_path, \"APP_ROOT\" => @process.config.root})\nif @port\n vars[\"PORT\"] = @port.to_s\nend\nvars\n"}},{"html_id":"failed?:Bool-instance-method","name":"failed?","doc":"\nHas this failed?\n","summary":"

Has this failed?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":202,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L202"},"def":{"name":"failed?","return_type":"Bool","visibility":"Public","body":"@failed ? true : false"}},{"html_id":"id:Int32-instance-method","name":"id","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L15"},"def":{"name":"id","visibility":"Public","body":"@id"}},{"html_id":"on_stop-instance-method","name":"on_stop","doc":"\nA method that will be called when this instance has been stopped and it isn't going to be\nstarted again\n","summary":"

A method that will be called when this instance has been stopped and it isn't going to be started again

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":226,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L226"},"def":{"name":"on_stop","visibility":"Public","body":"@started_at = nil\n@stopped = true\ntidy\n"}},{"html_id":"pid:Int64-instance-method","name":"pid","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"pid","visibility":"Public","body":"@pid"}},{"html_id":"pid=(pid:Int64)-instance-method","name":"pid=","abstract":false,"args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"args_string":"(pid : Int64)","args_html":"(pid : Int64)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"pid=","args":[{"name":"pid","external_name":"pid","restriction":"::Int64"}],"visibility":"Public","body":"@pid = pid"}},{"html_id":"pid_file_path:String-instance-method","name":"pid_file_path","doc":"\nReturn the path to this instance's PID file\n","summary":"

Return the path to this instance's PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":71,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L71"},"def":{"name":"pid_file_path","return_type":"String","visibility":"Public","body":"File.join(@process.config.pid_root, \"#{description}.pid\")"}},{"html_id":"pid_from_file:Int64|Nil-instance-method","name":"pid_from_file","doc":"\nReturn the PID that is in the instances process PID file\n","summary":"

Return the PID that is in the instances process PID file

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":78,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L78"},"def":{"name":"pid_from_file","return_type":"Int64 | ::Nil","visibility":"Public","body":"if File.exists?(pid_file_path)\n pid = File.read(pid_file_path)\n pid.empty? ? nil : pid.strip.to_i64\nend"}},{"html_id":"port:Int32?-instance-method","name":"port","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"port","visibility":"Public","body":"@port"}},{"html_id":"port=(port:Int32|Nil)-instance-method","name":"port=","abstract":false,"args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"args_string":"(port : Int32 | Nil)","args_html":"(port : Int32 | Nil)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"port=","args":[{"name":"port","external_name":"port","restriction":"::Int32 | ::Nil"}],"visibility":"Public","body":"@port = port"}},{"html_id":"port_available?(port):Bool-instance-method","name":"port_available?","doc":"\nIs the given port available?\n","summary":"

Is the given port available?

","abstract":false,"args":[{"name":"port","external_name":"port","restriction":""}],"args_string":"(port) : Bool","args_html":"(port) : Bool","location":{"filename":"src/procodile/instance.cr","line_number":408,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L408"},"def":{"name":"port_available?","args":[{"name":"port","external_name":"port","restriction":""}],"return_type":"Bool","visibility":"Public","body":"begin\n case @process.network_protocol\n when \"tcp\"\n server = TCPServer.new(\"127.0.0.1\", port)\n server.close\n true\n when \"udp\"\n server = UDPSocket.new\n server.bind(\"127.0.0.1\", port)\n server.close\n true\n else\n raise(Procodile::Error.new(\"Invalid network_protocol '#{@process.network_protocol}'\"))\n end\nrescue Socket::BindError\n false\nend"}},{"html_id":"process:Procodile::Process-instance-method","name":"process","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"process","visibility":"Public","body":"@process"}},{"html_id":"process=(process:Procodile::Process)-instance-method","name":"process=","abstract":false,"args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"args_string":"(process : Procodile::Process)","args_html":"(process : Procodile::Process)","location":{"filename":"src/procodile/instance.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L14"},"def":{"name":"process=","args":[{"name":"process","external_name":"process","restriction":"::Procodile::Process"}],"visibility":"Public","body":"@process = process"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","doc":"\nReturn the number of times this process has been respawned in the last hour\n","summary":"

Return the number of times this process has been respawned in the last hour

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":343,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L343"},"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"last_respawn = @last_respawn\nif (@respawns.nil? || last_respawn.nil?) || last_respawn < (Time.local - @process.respawn_window.seconds)\n 0\nelse\n @respawns\nend\n"}},{"html_id":"restart:self|Nil-instance-method","name":"restart","doc":"\nRetarts the process using the appropriate method from the process configuration\n","summary":"

Retarts the process using the appropriate method from the process configuration

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":243,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L243"},"def":{"name":"restart","return_type":"self | ::Nil","visibility":"Public","body":"restart_mode = @process.restart_mode\nProcodile.log(@process.log_color, description, \"Restarting using #{restart_mode} mode\")\nupdate_pid\ncase restart_mode\nwhen Signal::USR1, Signal::USR2\n if running?\n ::Process.signal(restart_mode.as(Signal), @pid)\n if @supervisor.tag\n @tag = @supervisor.tag\n end\n Procodile.log(@process.log_color, description, \"Sent #{restart_mode.to_s.upcase} signal to process #{@pid}\")\n else\n Procodile.log(@process.log_color, description, \"Process not running already. Starting it.\")\n on_stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n new_instance.start\n end\n self\nwhen \"start-term\"\n new_instance = @process.create_instance(@supervisor)\n new_instance.start\n stop\n new_instance\nwhen \"term-start\"\n stop\n new_instance = @process.create_instance(@supervisor)\n new_instance.port = self.port\n spawn do\n while running?\n sleep(0.5)\n end\n new_instance.start\n end\n new_instance\nend\n"}},{"html_id":"running?:Bool-instance-method","name":"running?","doc":"\nIs this process running? Pass an option to check the given PID instead of the instance\n","summary":"

Is this process running? Pass an option to check the given PID instead of the instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":88,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L88"},"def":{"name":"running?","return_type":"Bool","visibility":"Public","body":"begin\n if ( pid = @pid)\n ::Process.pgid(pid) ? true : false\n else\n false\n end\nrescue RuntimeError\n false\nend"}},{"html_id":"should_be_running?:Bool-instance-method","name":"should_be_running?","doc":"\nShould this process be running?\n","summary":"

Should this process be running?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L50"},"def":{"name":"should_be_running?","return_type":"Bool","visibility":"Public","body":"!(stopped? || stopping?)"}},{"html_id":"start-instance-method","name":"start","doc":"\nStart a new instance of this process\n","summary":"

Start a new instance of this process

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":101,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L101"},"def":{"name":"start","visibility":"Public","body":"if stopping?\n Procodile.log(@process.log_color, description, \"Process is stopped/stopping therefore cannot be started again.\")\n return false\nend\nupdate_pid\nif running?\n Procodile.log(@process.log_color, description, \"Already running with PID #{@pid}\")\n nil\nelse\n port_allocations = @supervisor.run_options.port_allocations\n if port_allocations && (chosen_port = port_allocations[@process.name]?)\n if chosen_port == 0\n allocate_port\n else\n @port = chosen_port\n Procodile.log(@process.log_color, description, \"Assigned #{chosen_port} to process\")\n end\n else\n if @process.proxy? && @supervisor.tcp_proxy\n allocate_port\n else\n if (proposed_port = @process.allocate_port_from) && (@process.restart_mode != \"start-term\")\n process = @supervisor.processes[@process]\n allocated_ports = process ? process.select(&.running?).map(&.port) : [] of Int32\n while !@port\n if allocated_ports.includes?(proposed_port)\n else\n @port = proposed_port\n end\n proposed_port = proposed_port + 1\n end\n end\n end\n end\n if self.process.log_path && (@supervisor.run_options.force_single_log != true)\n FileUtils.mkdir_p(File.dirname(self.process.log_path))\n log_destination = File.open(self.process.log_path, \"a\")\n io = nil\n else\n reader, writer = IO.pipe\n log_destination = writer\n io = reader\n end\n if @supervisor.tag\n @tag = @supervisor.tag.dup\n end\n Dir.cd(@process.config.root)\n commands = @process.command.split(\" \")\n process = ::Process.new(command: commands[0], args: commands[1..], env: environment_variables, output: log_destination, error: log_destination)\n @pid = process.pid\n log_destination.close\n File.write(pid_file_path, \"#{@pid}\\n\")\n @supervisor.add_instance(self, io)\n spawn do\n process.wait\n end\n Procodile.log(@process.log_color, description, \"Started with PID #{@pid}\" + (@tag ? \" (tagged with #{@tag})\" : \"\"))\n if self.process.log_path && io.nil?\n Procodile.log(@process.log_color, description, \"Logging to #{self.process.log_path}\")\n end\n @started_at = Time.local\nend\n"}},{"html_id":"status:String-instance-method","name":"status","doc":"\nReturn the status of this instance\n","summary":"

Return the status of this instance

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":33,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L33"},"def":{"name":"status","return_type":"String","visibility":"Public","body":"if stopped?\n \"Stopped\"\nelse\n if stopping?\n \"Stopping\"\n else\n if running?\n \"Running\"\n else\n if failed?\n \"Failed\"\n else\n \"Unknown\"\n end\n end\n end\nend"}},{"html_id":"stop-instance-method","name":"stop","doc":"\nSend this signal the signal to stop and mark the instance in a state that\ntells us that we want it to be stopped.\n","summary":"

Send this signal the signal to stop and mark the instance in a state that tells us that we want it to be stopped.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":210,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L210"},"def":{"name":"stop","visibility":"Public","body":"@stopping = Time.local\nupdate_pid\nif self.running?\n Procodile.log(@process.log_color, description, \"Sending #{@process.term_signal} to #{@pid}\")\n ::Process.signal(@process.term_signal, pid.not_nil!)\nelse\n Procodile.log(@process.log_color, description, \"Process already stopped\")\nend\n"}},{"html_id":"stopped?:Bool-instance-method","name":"stopped?","doc":"\nIs this stopped?\n","summary":"

Is this stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":195,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L195"},"def":{"name":"stopped?","return_type":"Bool","visibility":"Public","body":"@stopped || false"}},{"html_id":"stopping?:Bool-instance-method","name":"stopping?","doc":"\nIs this instance supposed to be stopping/be stopped?\n","summary":"

Is this instance supposed to be stopping/be stopped?

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":188,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L188"},"def":{"name":"stopping?","return_type":"Bool","visibility":"Public","body":"@stopping ? true : false"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L15"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tidy-instance-method","name":"tidy","doc":"\nTidy up when this process isn't needed any more\n","summary":"

Tidy up when this process isn't needed any more

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":235,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L235"},"def":{"name":"tidy","visibility":"Public","body":"FileUtils.rm_rf(self.pid_file_path)\nProcodile.log(@process.log_color, description, \"Removed PID file\")\n"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn this instance as a hash\n","summary":"

Return this instance as a hash

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":370,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L370"},"def":{"name":"to_hash","visibility":"Public","body":"started_at = @started_at\nInstanceConfig.new(description: self.description, pid: self.pid, respawns: self.respawns, status: self.status, running: self.running?, started_at: started_at ? started_at.to_unix : nil, tag: self.tag, port: @port)\n"}},{"html_id":"update_pid:Bool-instance-method","name":"update_pid","doc":"\nUpdate the locally cached PID from that stored on the file system.\n","summary":"

Update the locally cached PID from that stored on the file system.

","abstract":false,"location":{"filename":"src/procodile/instance.cr","line_number":288,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/instance.cr#L288"},"def":{"name":"update_pid","return_type":"Bool","visibility":"Public","body":"pid_from_file = self.pid_from_file\nif pid_from_file && (pid_from_file != @pid)\n @pid = pid_from_file\n @started_at = (File.info(self.pid_file_path)).modification_time\n Procodile.log(@process.log_color, description, \"PID file changed. Updated pid to #{@pid}\")\n true\nelse\n false\nend\n"}}]},{"html_id":"procodile/Procodile/InstanceConfig","path":"Procodile/InstanceConfig.html","kind":"struct","full_name":"Procodile::InstanceConfig","name":"InstanceConfig","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(description:String,pid:Int64|Nil,respawns:Int32,status:String,running:Bool,started_at:Int64|Nil,tag:String|Nil,port:Int32|Nil)-class-method","name":"new","abstract":false,"args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"args_string":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","args_html":"(description : String, pid : Int64 | Nil, respawns : Int32, status : String, running : Bool, started_at : Int64 | Nil, tag : String | Nil, port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"new","args":[{"name":"description","external_name":"description","restriction":"String"},{"name":"pid","external_name":"pid","restriction":"Int64 | ::Nil"},{"name":"respawns","external_name":"respawns","restriction":"Int32"},{"name":"status","external_name":"status","restriction":"String"},{"name":"running","external_name":"running","restriction":"Bool"},{"name":"started_at","external_name":"started_at","restriction":"Int64 | ::Nil"},{"name":"tag","external_name":"tag","restriction":"String | ::Nil"},{"name":"port","external_name":"port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(description, pid, respawns, status, running, started_at, tag, port)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":122,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L122"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@description.clone, @pid.clone, @respawns.clone, @status.clone, @running.clone, @started_at.clone, @tag.clone, @port.clone)"}},{"html_id":"copy_with(description_description=@description,pid_pid=@pid,respawns_respawns=@respawns,status_status=@status,running_running=@running,started_at_started_at=@started_at,tag_tag=@tag,port_port=@port)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"args_string":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","args_html":"(description _description = @description, pid _pid = @pid, respawns _respawns = @respawns, status _status = @status, running _running = @running, started_at _started_at = @started_at, tag _tag = @tag, port _port = @port)","location":{"filename":"src/procodile/procfile_option.cr","line_number":113,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L113"},"def":{"name":"copy_with","args":[{"name":"_description","default_value":"@description","external_name":"description","restriction":""},{"name":"_pid","default_value":"@pid","external_name":"pid","restriction":""},{"name":"_respawns","default_value":"@respawns","external_name":"respawns","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""},{"name":"_running","default_value":"@running","external_name":"running","restriction":""},{"name":"_started_at","default_value":"@started_at","external_name":"started_at","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_port","default_value":"@port","external_name":"port","restriction":""}],"visibility":"Public","body":"self.class.new(_description, _pid, _respawns, _status, _running, _started_at, _tag, _port)"}},{"html_id":"description:String-instance-method","name":"description","abstract":false,"def":{"name":"description","return_type":"String","visibility":"Public","body":"@description"}},{"html_id":"pid:Int64|Nil-instance-method","name":"pid","abstract":false,"def":{"name":"pid","return_type":"Int64 | ::Nil","visibility":"Public","body":"@pid"}},{"html_id":"port:Int32|Nil-instance-method","name":"port","abstract":false,"def":{"name":"port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@port"}},{"html_id":"respawns:Int32-instance-method","name":"respawns","abstract":false,"def":{"name":"respawns","return_type":"Int32","visibility":"Public","body":"@respawns"}},{"html_id":"running:Bool-instance-method","name":"running","abstract":false,"def":{"name":"running","return_type":"Bool","visibility":"Public","body":"@running"}},{"html_id":"started_at:Int64|Nil-instance-method","name":"started_at","abstract":false,"def":{"name":"started_at","return_type":"Int64 | ::Nil","visibility":"Public","body":"@started_at"}},{"html_id":"status:String-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String","visibility":"Public","body":"@status"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/Message","path":"Procodile/Message.html","kind":"module","full_name":"Procodile::Message","name":"Message","abstract":false,"locations":[{"filename":"src/procodile/message.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"parse(message)-class-method","name":"parse","abstract":false,"args":[{"name":"message","external_name":"message","restriction":""}],"args_string":"(message)","args_html":"(message)","location":{"filename":"src/procodile/message.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/message.cr#L3"},"def":{"name":"parse","args":[{"name":"message","external_name":"message","restriction":""}],"visibility":"Public","body":"case message.type\nwhen \"not_running\"\n \"#{message.instance} is not running (#{message.status})\"\nwhen \"incorrect_quantity\"\n \"#{message.process} only has #{message.current} instances (should have #{message.desired})\"\nend"}}]},{"html_id":"procodile/Procodile/Process","path":"Procodile/Process.html","kind":"class","full_name":"Procodile::Process","name":"Process","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/process.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"MUTEX","name":"MUTEX","value":"Mutex.new"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,name:String,command:String,options:Procodile::ProcessOption=ProcessOption.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","args_html":"(config : Procodile::Config, name : String, command : String, options : Procodile::ProcessOption = ProcessOption.new)","location":{"filename":"src/procodile/process.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L16"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"::Procodile::Config"},{"name":"name","external_name":"name","restriction":"::String"},{"name":"command","external_name":"command","restriction":"::String"},{"name":"options","default_value":"ProcessOption.new","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, name, command, options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","doc":"\nReturn the first port that ports should be allocated from for this process\n","summary":"

Return the first port that ports should be allocated from for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":124,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L124"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@options.allocate_port_from"}},{"html_id":"command:String-instance-method","name":"command","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"command","visibility":"Public","body":"@command"}},{"html_id":"command=(command:String)-instance-method","name":"command=","abstract":false,"args":[{"name":"command","external_name":"command","restriction":"::String"}],"args_string":"(command : String)","args_html":"(command : String)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"command=","args":[{"name":"command","external_name":"command","restriction":"::String"}],"visibility":"Public","body":"@command = command"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"correct_quantity?(quantity)-instance-method","name":"correct_quantity?","doc":"\nIs the given quantity suitable for this process?\n","summary":"

Is the given quantity suitable for this process?

","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":""}],"args_string":"(quantity)","args_html":"(quantity)","location":{"filename":"src/procodile/process.cr","line_number":198,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L198"},"def":{"name":"correct_quantity?","args":[{"name":"quantity","external_name":"quantity","restriction":""}],"visibility":"Public","body":"if self.restart_mode == \"start-term\"\n quantity >= self.quantity\nelse\n self.quantity == quantity\nend"}},{"html_id":"create_instance(supervisor):Instance-instance-method","name":"create_instance","doc":"\nCreate a new instance\n","summary":"

Create a new instance

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor) : Instance","args_html":"(supervisor) : Instance","location":{"filename":"src/procodile/process.cr","line_number":166,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L166"},"def":{"name":"create_instance","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"return_type":"Instance","visibility":"Public","body":"Instance.new(supervisor, self, get_instance_id)"}},{"html_id":"default_log_file_name:String-instance-method","name":"default_log_file_name","doc":"\nReturn the defualt log file name\n","summary":"

Return the defualt log file name

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L86"},"def":{"name":"default_log_file_name","return_type":"String","visibility":"Public","body":"@options.log_file_name || \"#{@name}.log\""}},{"html_id":"default_log_path:String-instance-method","name":"default_log_path","doc":"\nReturn the log path for this process if no log path is provided and split logs\nis enabled\n","summary":"

Return the log path for this process if no log path is provided and split logs is enabled

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":94,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L94"},"def":{"name":"default_log_path","return_type":"String","visibility":"Public","body":"if (lr = @config.log_root)\n File.join(lr, default_log_file_name)\nelse\n File.join(@config.root, default_log_file_name)\nend"}},{"html_id":"environment_variables:Hash(String,String)-instance-method","name":"environment_variables","doc":"\nReturn all environment variables for this process\n","summary":"

Return all environment variables for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L34"},"def":{"name":"environment_variables","return_type":"Hash(String, String)","visibility":"Public","body":"global_variables = @config.environment_variables\nprocess_vars = if (process = @config.process_options[@name]?)\n process.env || ({} of String => String)\nelse\n {} of String => String\nend\nprocess_local_vars = if (local_process = @config.local_process_options[@name]?)\n local_process.env || ({} of String => String)\nelse\n {} of String => String\nend\nglobal_variables.merge(process_vars.merge(process_local_vars))\n"}},{"html_id":"generate_instances(supervisor,quantity=self.quantity):Array(Procodile::Instance)-instance-method","name":"generate_instances","doc":"\nGenerate an array of new instances for this process (based on its quantity)\n","summary":"

Generate an array of new instances for this process (based on its quantity)

","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"args_string":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","args_html":"(supervisor, quantity = self.quantity) : Array(Procodile::Instance)","location":{"filename":"src/procodile/process.cr","line_number":159,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L159"},"def":{"name":"generate_instances","args":[{"name":"supervisor","external_name":"supervisor","restriction":""},{"name":"quantity","default_value":"self.quantity","external_name":"quantity","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"Array.new(quantity) do\n create_instance(supervisor)\nend"}},{"html_id":"get_instance_id:Int32-instance-method","name":"get_instance_id","doc":"\nIncrease the instance index and return\n","summary":"

Increase the instance index and return

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":24,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L24"},"def":{"name":"get_instance_id","return_type":"Int32","visibility":"Public","body":"MUTEX.synchronize do\n if @instance_index == 10000\n @instance_index = 0\n end\n @instance_index = @instance_index + 1\nend"}},{"html_id":"log_color:Int32-instance-method","name":"log_color","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"log_color","visibility":"Public","body":"@log_color"}},{"html_id":"log_color=(log_color:Int32)-instance-method","name":"log_color=","abstract":false,"args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"args_string":"(log_color : Int32)","args_html":"(log_color : Int32)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"log_color=","args":[{"name":"log_color","external_name":"log_color","restriction":"::Int32"}],"visibility":"Public","body":"@log_color = log_color"}},{"html_id":"log_path:String-instance-method","name":"log_path","doc":"\nReturn the path where log output for this process should be written to. If\nnone, output will be written to the supervisor log.\n","summary":"

Return the path where log output for this process should be written to.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":77,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L77"},"def":{"name":"log_path","return_type":"String","visibility":"Public","body":"log_path = @options.log_path\nlog_path ? File.expand_path(log_path, @config.root) : default_log_path\n"}},{"html_id":"max_respawns:Int32-instance-method","name":"max_respawns","doc":"\nThe maximum number of times this process can be respawned in the given period\n","summary":"

The maximum number of times this process can be respawned in the given period

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":62,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L62"},"def":{"name":"max_respawns","return_type":"Int32","visibility":"Public","body":"@options.max_respawns || 5"}},{"html_id":"name:String-instance-method","name":"name","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L13"},"def":{"name":"name","visibility":"Public","body":"@name"}},{"html_id":"network_protocol:String-instance-method","name":"network_protocol","doc":"\nReturn the network protocol for this process\n","summary":"

Return the network protocol for this process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":152,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L152"},"def":{"name":"network_protocol","return_type":"String","visibility":"Public","body":"@options.network_protocol || \"tcp\""}},{"html_id":"options:Procodile::ProcessOption-instance-method","name":"options","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"options","visibility":"Public","body":"@options"}},{"html_id":"options=(options:Procodile::ProcessOption)-instance-method","name":"options=","abstract":false,"args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"args_string":"(options : Procodile::ProcessOption)","args_html":"(options : Procodile::ProcessOption)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"options=","args":[{"name":"options","external_name":"options","restriction":"::Procodile::ProcessOption"}],"visibility":"Public","body":"@options = options"}},{"html_id":"proxy?:Bool-instance-method","name":"proxy?","doc":"\nIs this process enabled for proxying?\n","summary":"

Is this process enabled for proxying?

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":131,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L131"},"def":{"name":"proxy?","return_type":"Bool","visibility":"Public","body":"!(!@options.proxy_port)"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L145"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_address || \"127.0.0.1\" : nil"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","doc":"\nReturn the port for the proxy to listen on for this process type\n","summary":"

Return the port for the proxy to listen on for this process type

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":138,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L138"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"proxy? ? @options.proxy_port : nil"}},{"html_id":"quantity:Int32-instance-method","name":"quantity","doc":"\nHow many instances of this process should be started\n","summary":"

How many instances of this process should be started

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L55"},"def":{"name":"quantity","return_type":"Int32","visibility":"Public","body":"@options.quantity || 1"}},{"html_id":"removed:Bool-instance-method","name":"removed","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"removed","visibility":"Public","body":"@removed"}},{"html_id":"removed=(removed:Bool)-instance-method","name":"removed=","abstract":false,"args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"args_string":"(removed : Bool)","args_html":"(removed : Bool)","location":{"filename":"src/procodile/process.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L14"},"def":{"name":"removed=","args":[{"name":"removed","external_name":"removed","restriction":"::Bool"}],"visibility":"Public","body":"@removed = removed"}},{"html_id":"respawn_window:Int32-instance-method","name":"respawn_window","doc":"\nThe respawn window. One hour by default.\n","summary":"

The respawn window.

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":69,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L69"},"def":{"name":"respawn_window","return_type":"Int32","visibility":"Public","body":"@options.respawn_window || 3600"}},{"html_id":"restart_mode:String|Signal-instance-method","name":"restart_mode","doc":"\nDefines how this process should be restarted\n\nstart-term = start new instances and send term to children\nusr1 = just send a usr1 signal to the current instance\nusr2 = just send a usr2 signal to the current instance\nterm-start = stop the old instances, when no longer running, start a new one\n","summary":"

Defines how this process should be restarted

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":117,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L117"},"def":{"name":"restart_mode","return_type":"String | Signal","visibility":"Public","body":"@options.restart_mode || \"term-start\""}},{"html_id":"term_signal:Signal-instance-method","name":"term_signal","doc":"\nReturn the signal to send to terminate the process\n","summary":"

Return the signal to send to terminate the process

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L105"},"def":{"name":"term_signal","return_type":"Signal","visibility":"Public","body":"@options.term_signal || Signal::TERM"}},{"html_id":"to_hash-instance-method","name":"to_hash","doc":"\nReturn a hash\n","summary":"

Return a hash

","abstract":false,"location":{"filename":"src/procodile/process.cr","line_number":179,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/process.cr#L179"},"def":{"name":"to_hash","visibility":"Public","body":"ControlClientProcessStatus.new(name: self.name, log_color: self.log_color, quantity: self.quantity, max_respawns: self.max_respawns, respawn_window: self.respawn_window, command: self.command, restart_mode: self.restart_mode, log_path: self.log_path, removed: self.removed ? true : false, proxy_port: proxy_port, proxy_address: proxy_address)"}}]},{"html_id":"procodile/Procodile/ProcessOption","path":"Procodile/ProcessOption.html","kind":"struct","full_name":"Procodile::ProcessOption","name":"ProcessOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":6,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L6"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":7,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L7"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":22,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L22"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"allocate_port_from:Int32|Nil-instance-method","name":"allocate_port_from","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from","return_type":"Int32 | ::Nil","visibility":"Public","body":"@allocate_port_from"}},{"html_id":"allocate_port_from=(allocate_port_from:Int32|Nil)-instance-method","name":"allocate_port_from=","abstract":false,"args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"args_string":"(allocate_port_from : Int32 | Nil)","args_html":"(allocate_port_from : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":16,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L16"},"def":{"name":"allocate_port_from=","args":[{"name":"allocate_port_from","external_name":"allocate_port_from","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@allocate_port_from = allocate_port_from"}},{"html_id":"env:Hash(String,String)-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L20"},"def":{"name":"env","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String))-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"args_string":"(env : Hash(String, String))","args_html":"(env : Hash(String, String))","location":{"filename":"src/procodile/procfile_option.cr","line_number":20,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L20"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"::Hash(::String, ::String)"}],"visibility":"Public","body":"@env = env"}},{"html_id":"log_file_name:String|Nil-instance-method","name":"log_file_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name","return_type":"String | ::Nil","visibility":"Public","body":"@log_file_name"}},{"html_id":"log_file_name=(log_file_name:String|Nil)-instance-method","name":"log_file_name=","abstract":false,"args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"args_string":"(log_file_name : String | Nil)","args_html":"(log_file_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L14"},"def":{"name":"log_file_name=","args":[{"name":"log_file_name","external_name":"log_file_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_file_name = log_file_name"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L13"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"max_respawns:Int32|Nil-instance-method","name":"max_respawns","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns","return_type":"Int32 | ::Nil","visibility":"Public","body":"@max_respawns"}},{"html_id":"max_respawns=(max_respawns:Int32|Nil)-instance-method","name":"max_respawns=","abstract":false,"args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"args_string":"(max_respawns : Int32 | Nil)","args_html":"(max_respawns : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":11,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L11"},"def":{"name":"max_respawns=","args":[{"name":"max_respawns","external_name":"max_respawns","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@max_respawns = max_respawns"}},{"html_id":"merge(other:self|Nil)-instance-method","name":"merge","abstract":false,"args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"args_string":"(other : self | Nil)","args_html":"(other : self | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":25,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L25"},"def":{"name":"merge","args":[{"name":"other","external_name":"other","restriction":"self | ::Nil"}],"visibility":"Public","body":"new_process_option = self\nif other.quantity\n new_process_option.quantity = other.quantity\nend\nif other.restart_mode\n new_process_option.restart_mode = other.restart_mode\nend\nif other.max_respawns\n new_process_option.max_respawns = other.max_respawns\nend\nif other.respawn_window\n new_process_option.respawn_window = other.respawn_window\nend\nif other.log_path\n new_process_option.log_path = other.log_path\nend\nif other.log_file_name\n new_process_option.log_file_name = other.log_file_name\nend\nif other.term_signal\n new_process_option.term_signal = other.term_signal\nend\nif other.allocate_port_from\n new_process_option.allocate_port_from = other.allocate_port_from\nend\nif other.proxy_port\n new_process_option.proxy_port = other.proxy_port\nend\nif other.proxy_address\n new_process_option.proxy_address = other.proxy_address\nend\nif other.network_protocol\n new_process_option.network_protocol = other.network_protocol\nend\nif other.env\n new_process_option.env = new_process_option.env.merge(other.env)\nend\nnew_process_option\n"}},{"html_id":"network_protocol:String|Nil-instance-method","name":"network_protocol","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol","return_type":"String | ::Nil","visibility":"Public","body":"@network_protocol"}},{"html_id":"network_protocol=(network_protocol:String|Nil)-instance-method","name":"network_protocol=","abstract":false,"args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"args_string":"(network_protocol : String | Nil)","args_html":"(network_protocol : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":19,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L19"},"def":{"name":"network_protocol=","args":[{"name":"network_protocol","external_name":"network_protocol","restriction":"String | ::Nil"}],"visibility":"Public","body":"@network_protocol = network_protocol"}},{"html_id":"proxy_address:String|Nil-instance-method","name":"proxy_address","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address","return_type":"String | ::Nil","visibility":"Public","body":"@proxy_address"}},{"html_id":"proxy_address=(proxy_address:String|Nil)-instance-method","name":"proxy_address=","abstract":false,"args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"args_string":"(proxy_address : String | Nil)","args_html":"(proxy_address : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":18,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L18"},"def":{"name":"proxy_address=","args":[{"name":"proxy_address","external_name":"proxy_address","restriction":"String | ::Nil"}],"visibility":"Public","body":"@proxy_address = proxy_address"}},{"html_id":"proxy_port:Int32|Nil-instance-method","name":"proxy_port","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port","return_type":"Int32 | ::Nil","visibility":"Public","body":"@proxy_port"}},{"html_id":"proxy_port=(proxy_port:Int32|Nil)-instance-method","name":"proxy_port=","abstract":false,"args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"args_string":"(proxy_port : Int32 | Nil)","args_html":"(proxy_port : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":17,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L17"},"def":{"name":"proxy_port=","args":[{"name":"proxy_port","external_name":"proxy_port","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@proxy_port = proxy_port"}},{"html_id":"quantity:Int32|Nil-instance-method","name":"quantity","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity","return_type":"Int32 | ::Nil","visibility":"Public","body":"@quantity"}},{"html_id":"quantity=(quantity:Int32|Nil)-instance-method","name":"quantity=","abstract":false,"args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"args_string":"(quantity : Int32 | Nil)","args_html":"(quantity : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L9"},"def":{"name":"quantity=","args":[{"name":"quantity","external_name":"quantity","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@quantity = quantity"}},{"html_id":"respawn_window:Int32|Nil-instance-method","name":"respawn_window","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window","return_type":"Int32 | ::Nil","visibility":"Public","body":"@respawn_window"}},{"html_id":"respawn_window=(respawn_window:Int32|Nil)-instance-method","name":"respawn_window=","abstract":false,"args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"args_string":"(respawn_window : Int32 | Nil)","args_html":"(respawn_window : Int32 | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L12"},"def":{"name":"respawn_window=","args":[{"name":"respawn_window","external_name":"respawn_window","restriction":"Int32 | ::Nil"}],"visibility":"Public","body":"@respawn_window = respawn_window"}},{"html_id":"restart_mode:Signal|String|Nil-instance-method","name":"restart_mode","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode","return_type":"Signal | String | Nil","visibility":"Public","body":"@restart_mode"}},{"html_id":"restart_mode=(restart_mode:Signal|String|Nil)-instance-method","name":"restart_mode=","abstract":false,"args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"args_string":"(restart_mode : Signal | String | Nil)","args_html":"(restart_mode : Signal | String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":10,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L10"},"def":{"name":"restart_mode=","args":[{"name":"restart_mode","external_name":"restart_mode","restriction":"Signal | String | Nil"}],"visibility":"Public","body":"@restart_mode = restart_mode"}},{"html_id":"term_signal:Signal|Nil-instance-method","name":"term_signal","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal","return_type":"Signal | ::Nil","visibility":"Public","body":"@term_signal"}},{"html_id":"term_signal=(term_signal:Signal|Nil)-instance-method","name":"term_signal=","abstract":false,"args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"args_string":"(term_signal : Signal | Nil)","args_html":"(term_signal : Signal | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L15"},"def":{"name":"term_signal=","args":[{"name":"term_signal","external_name":"term_signal","restriction":"Signal | ::Nil"}],"visibility":"Public","body":"@term_signal = term_signal"}}]},{"html_id":"procodile/Procodile/ProcfileOption","path":"Procodile/ProcfileOption.html","kind":"struct","full_name":"Procodile::ProcfileOption","name":"ProcfileOption","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L45"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/YAML/Serializable","kind":"module","full_name":"YAML::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method","name":"new","abstract":false,"args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"args_string":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","args_html":"(ctx : YAML::ParseContext, node : YAML::Nodes::Node)","location":{"filename":"src/procodile/procfile_option.cr","line_number":46,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L46"},"def":{"name":"new","args":[{"name":"ctx","external_name":"ctx","restriction":"YAML::ParseContext"},{"name":"node","external_name":"node","restriction":"YAML::Nodes::Node"}],"visibility":"Public","body":"new_from_yaml_node(ctx, node)"}},{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":60,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L60"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"app_name:String|Nil-instance-method","name":"app_name","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name","return_type":"String | ::Nil","visibility":"Public","body":"@app_name"}},{"html_id":"app_name=(app_name:String|Nil)-instance-method","name":"app_name=","abstract":false,"args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"args_string":"(app_name : String | Nil)","args_html":"(app_name : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":48,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L48"},"def":{"name":"app_name=","args":[{"name":"app_name","external_name":"app_name","restriction":"String | ::Nil"}],"visibility":"Public","body":"@app_name = app_name"}},{"html_id":"console_command:String|Nil-instance-method","name":"console_command","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command","return_type":"String | ::Nil","visibility":"Public","body":"@console_command"}},{"html_id":"console_command=(console_command:String|Nil)-instance-method","name":"console_command=","abstract":false,"args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"args_string":"(console_command : String | Nil)","args_html":"(console_command : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":55,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L55"},"def":{"name":"console_command=","args":[{"name":"console_command","external_name":"console_command","restriction":"String | ::Nil"}],"visibility":"Public","body":"@console_command = console_command"}},{"html_id":"env:Hash(String,String)|Nil-instance-method","name":"env","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L57"},"def":{"name":"env","return_type":"Hash(String, String) | ::Nil","visibility":"Public","body":"@env"}},{"html_id":"env=(env:Hash(String,String)|Nil)-instance-method","name":"env=","abstract":false,"args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"args_string":"(env : Hash(String, String) | Nil)","args_html":"(env : Hash(String, String) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":57,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L57"},"def":{"name":"env=","args":[{"name":"env","external_name":"env","restriction":"Hash(String, String) | ::Nil"}],"visibility":"Public","body":"@env = env"}},{"html_id":"exec_prefix:String|Nil-instance-method","name":"exec_prefix","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix","return_type":"String | ::Nil","visibility":"Public","body":"@exec_prefix"}},{"html_id":"exec_prefix=(exec_prefix:String|Nil)-instance-method","name":"exec_prefix=","abstract":false,"args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"args_string":"(exec_prefix : String | Nil)","args_html":"(exec_prefix : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":56,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L56"},"def":{"name":"exec_prefix=","args":[{"name":"exec_prefix","external_name":"exec_prefix","restriction":"String | ::Nil"}],"visibility":"Public","body":"@exec_prefix = exec_prefix"}},{"html_id":"log_path:String|Nil-instance-method","name":"log_path","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path","return_type":"String | ::Nil","visibility":"Public","body":"@log_path"}},{"html_id":"log_path=(log_path:String|Nil)-instance-method","name":"log_path=","abstract":false,"args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"args_string":"(log_path : String | Nil)","args_html":"(log_path : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":52,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L52"},"def":{"name":"log_path=","args":[{"name":"log_path","external_name":"log_path","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_path = log_path"}},{"html_id":"log_root:String|Nil-instance-method","name":"log_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root","return_type":"String | ::Nil","visibility":"Public","body":"@log_root"}},{"html_id":"log_root=(log_root:String|Nil)-instance-method","name":"log_root=","abstract":false,"args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"args_string":"(log_root : String | Nil)","args_html":"(log_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":53,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L53"},"def":{"name":"log_root=","args":[{"name":"log_root","external_name":"log_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@log_root = log_root"}},{"html_id":"pid_root:String|Nil-instance-method","name":"pid_root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root","return_type":"String | ::Nil","visibility":"Public","body":"@pid_root"}},{"html_id":"pid_root=(pid_root:String|Nil)-instance-method","name":"pid_root=","abstract":false,"args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"args_string":"(pid_root : String | Nil)","args_html":"(pid_root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":51,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L51"},"def":{"name":"pid_root=","args":[{"name":"pid_root","external_name":"pid_root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@pid_root = pid_root"}},{"html_id":"processes:Hash(String,ProcessOption)|Nil-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes","return_type":"Hash(String, ProcessOption) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"processes=(processes:Hash(String,ProcessOption)|Nil)-instance-method","name":"processes=","abstract":false,"args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"args_string":"(processes : Hash(String, ProcessOption) | Nil)","args_html":"(processes : Hash(String, ProcessOption) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":58,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L58"},"def":{"name":"processes=","args":[{"name":"processes","external_name":"processes","restriction":"Hash(String, ProcessOption) | ::Nil"}],"visibility":"Public","body":"@processes = processes"}},{"html_id":"procfile:String|Nil-instance-method","name":"procfile","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile","return_type":"String | ::Nil","visibility":"Public","body":"@procfile"}},{"html_id":"procfile=(procfile:String|Nil)-instance-method","name":"procfile=","abstract":false,"args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"args_string":"(procfile : String | Nil)","args_html":"(procfile : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":50,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L50"},"def":{"name":"procfile=","args":[{"name":"procfile","external_name":"procfile","restriction":"String | ::Nil"}],"visibility":"Public","body":"@procfile = procfile"}},{"html_id":"root:String|Nil-instance-method","name":"root","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L49"},"def":{"name":"root","return_type":"String | ::Nil","visibility":"Public","body":"@root"}},{"html_id":"root=(root:String|Nil)-instance-method","name":"root=","abstract":false,"args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"args_string":"(root : String | Nil)","args_html":"(root : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":49,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L49"},"def":{"name":"root=","args":[{"name":"root","external_name":"root","restriction":"String | ::Nil"}],"visibility":"Public","body":"@root = root"}},{"html_id":"user:String|Nil-instance-method","name":"user","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L54"},"def":{"name":"user","return_type":"String | ::Nil","visibility":"Public","body":"@user"}},{"html_id":"user=(user:String|Nil)-instance-method","name":"user=","abstract":false,"args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"args_string":"(user : String | Nil)","args_html":"(user : String | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":54,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L54"},"def":{"name":"user=","args":[{"name":"user","external_name":"user","restriction":"String | ::Nil"}],"visibility":"Public","body":"@user = user"}}]},{"html_id":"procodile/Procodile/RunOptions","path":"Procodile/RunOptions.html","kind":"struct","full_name":"Procodile::RunOptions","name":"RunOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"},"def":{"name":"new","visibility":"Public","body":"x = allocate\nif x.responds_to?(:finalize)\n ::GC.add_finalizer(x)\nend\nx\n"}}],"instance_methods":[{"html_id":"force_single_log:Bool|Nil-instance-method","name":"force_single_log","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log","return_type":"Bool | ::Nil","visibility":"Public","body":"@force_single_log"}},{"html_id":"force_single_log=(force_single_log:Bool|Nil)-instance-method","name":"force_single_log=","abstract":false,"args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"args_string":"(force_single_log : Bool | Nil)","args_html":"(force_single_log : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":109,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L109"},"def":{"name":"force_single_log=","args":[{"name":"force_single_log","external_name":"force_single_log","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@force_single_log = force_single_log"}},{"html_id":"initialize-instance-method","name":"initialize","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":105,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L105"},"def":{"name":"initialize","visibility":"Public","body":""}},{"html_id":"port_allocations:Hash(String,Int32)|Nil-instance-method","name":"port_allocations","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations","return_type":"Hash(String, Int32) | ::Nil","visibility":"Public","body":"@port_allocations"}},{"html_id":"port_allocations=(port_allocations:Hash(String,Int32)|Nil)-instance-method","name":"port_allocations=","abstract":false,"args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"args_string":"(port_allocations : Hash(String, Int32) | Nil)","args_html":"(port_allocations : Hash(String, Int32) | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L110"},"def":{"name":"port_allocations=","args":[{"name":"port_allocations","external_name":"port_allocations","restriction":"Hash(String, Int32) | ::Nil"}],"visibility":"Public","body":"@port_allocations = port_allocations"}},{"html_id":"proxy:Bool|Nil-instance-method","name":"proxy","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy","return_type":"Bool | ::Nil","visibility":"Public","body":"@proxy"}},{"html_id":"proxy=(proxy:Bool|Nil)-instance-method","name":"proxy=","abstract":false,"args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"args_string":"(proxy : Bool | Nil)","args_html":"(proxy : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":108,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L108"},"def":{"name":"proxy=","args":[{"name":"proxy","external_name":"proxy","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@proxy = proxy"}},{"html_id":"respawn:Bool|Nil-instance-method","name":"respawn","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn","return_type":"Bool | ::Nil","visibility":"Public","body":"@respawn"}},{"html_id":"respawn=(respawn:Bool|Nil)-instance-method","name":"respawn=","abstract":false,"args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"args_string":"(respawn : Bool | Nil)","args_html":"(respawn : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":106,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L106"},"def":{"name":"respawn=","args":[{"name":"respawn","external_name":"respawn","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@respawn = respawn"}},{"html_id":"stop_when_none:Bool|Nil-instance-method","name":"stop_when_none","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_when_none"}},{"html_id":"stop_when_none=(stop_when_none:Bool|Nil)-instance-method","name":"stop_when_none=","abstract":false,"args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"args_string":"(stop_when_none : Bool | Nil)","args_html":"(stop_when_none : Bool | Nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":107,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L107"},"def":{"name":"stop_when_none=","args":[{"name":"stop_when_none","external_name":"stop_when_none","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"@stop_when_none = stop_when_none"}}]},{"html_id":"procodile/Procodile/SignalHandler","path":"Procodile/SignalHandler.html","kind":"class","full_name":"Procodile::SignalHandler","name":"SignalHandler","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/signal_handler.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"QUEUE","name":"QUEUE","value":"[] of Signal"},{"id":"SIGNALS","name":"SIGNALS","value":"{Signal::TERM, Signal::USR1, Signal::USR2, Signal::INT, Signal::HUP}"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new-class-method","name":"new","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":14,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L14"},"def":{"name":"new","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"handle-instance-method","name":"handle","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":45,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L45"},"def":{"name":"handle","visibility":"Public","body":"if (signal = QUEUE.shift?)\n Procodile.log(nil, \"system\", \"Supervisor received #{signal} signal\")\n @handlers[signal].try(&.each(&.call))\nend"}},{"html_id":"notice-instance-method","name":"notice","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":41,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L41"},"def":{"name":"notice","visibility":"Public","body":"@pipe[:writer].write(\".\".to_slice)"}},{"html_id":"pipe:Hash(Symbol,IO::FileDescriptor)-instance-method","name":"pipe","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":12,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L12"},"def":{"name":"pipe","return_type":"Hash(Symbol, IO::FileDescriptor)","visibility":"Public","body":"@pipe"}},{"html_id":"register(signal:Signal,&block)-instance-method","name":"register","abstract":false,"args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"args_string":"(signal : Signal, &block)","args_html":"(signal : Signal, &block)","location":{"filename":"src/procodile/signal_handler.cr","line_number":36,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L36"},"def":{"name":"register","args":[{"name":"signal","external_name":"signal","restriction":"Signal"}],"yields":0,"block_arity":0,"block_arg":{"name":"block","external_name":"block","restriction":""},"visibility":"Public","body":"__temp_54 = signal\n@handlers[__temp_54]? || (@handlers[__temp_54] = [] of Proc(Nil))\n@handlers[signal] << block\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/signal_handler.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/signal_handler.cr#L27"},"def":{"name":"start","visibility":"Public","body":"spawn do\n loop do\n handle\n sleep(1)\n end\nend"}}]},{"html_id":"procodile/Procodile/StatusCLIOutput","path":"Procodile/StatusCLIOutput.html","kind":"class","full_name":"Procodile::StatusCLIOutput","name":"StatusCLIOutput","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/status_cli_output.cr","line_number":4,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L4"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(status:Procodile::ControlClientReplyForStatusCommand)-class-method","name":"new","abstract":false,"args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"args_string":"(status : Procodile::ControlClientReplyForStatusCommand)","args_html":"(status : Procodile::ControlClientReplyForStatusCommand)","location":{"filename":"src/procodile/status_cli_output.cr","line_number":5,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L5"},"def":{"name":"new","args":[{"name":"status","external_name":"status","restriction":"Procodile::ControlClientReplyForStatusCommand"}],"visibility":"Public","body":"_ = allocate\n_.initialize(status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"print_all-instance-method","name":"print_all","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":8,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L8"},"def":{"name":"print_all","visibility":"Public","body":"print_header\nprint_processes\n"}},{"html_id":"print_header-instance-method","name":"print_header","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L13"},"def":{"name":"print_header","visibility":"Public","body":"puts(\"Procodile Version #{@status.version.to_s.color(34)}\")\nputs(\"Application Root #{(@status.root).to_s.color(34)}\")\nputs(\"Supervisor PID #{(@status.supervisor[\"pid\"]).to_s.color(34)}\")\nif (time = @status.supervisor[\"started_at\"])\n time = Time.unix(time)\n puts(\"Started #{time.to_s.color(34)}\")\nend\nif !@status.environment_variables.empty?\n @status.environment_variables.each_with_index do |__arg0, index|\n key = __arg0[0]\n value = __arg0[1]\n if index == 0\n print(\"Environment Vars \")\n else\n print(\" \")\n end\n print(key.color(34))\n puts(\" #{value}\")\n end\nend\nif @status.messages.empty?\nelse\n puts\n @status.messages.each do |message|\n puts(\"\\e[31m * #{Message.parse(message)}\\e[0m\")\n end\nend\n"}},{"html_id":"print_processes-instance-method","name":"print_processes","abstract":false,"location":{"filename":"src/procodile/status_cli_output.cr","line_number":40,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/status_cli_output.cr#L40"},"def":{"name":"print_processes","visibility":"Public","body":"puts\n@status.processes.each_with_index do |process, index|\n if index == 0\n else\n puts\n end\n puts((\"|| \".color(process.log_color)) + (process.name.color(process.log_color)))\n puts(\"#{\"||\".color(process.log_color)} Quantity #{process.quantity}\")\n puts(\"#{\"||\".color(process.log_color)} Command #{process.command}\")\n puts(\"#{\"||\".color(process.log_color)} Respawning #{process.max_respawns} every #{process.respawn_window} seconds\")\n puts(\"#{\"||\".color(process.log_color)} Restart mode #{process.restart_mode}\")\n puts(\"#{\"||\".color(process.log_color)} Log path #{process.log_path || \"none specified\"}\")\n puts(\"#{\"||\".color(process.log_color)} Address/Port #{process.proxy_port ? \"#{process.proxy_address}:#{process.proxy_port}\" : \"none\"}\")\n instances = @status.instances[process.name]\n if instances.empty?\n puts(\"#{\"||\".color(process.log_color)} No processes running.\")\n else\n instances.each do |instance|\n print((\"|| => \".color(process.log_color)) + ((instance.description.to_s.ljust(17, ' ')).color(process.log_color)))\n print(instance.status.ljust(10, ' '))\n print(\" #{(formatted_timestamp(instance.started_at)).ljust(10, ' ')}\")\n print(\" pid:#{instance.pid.to_s.ljust(6, ' ')}\")\n print(\" respawns:#{instance.respawns.to_s.ljust(4, ' ')}\")\n print(\" port:#{(instance.port || '-').to_s.ljust(6, ' ')}\")\n print(\" tag:#{instance.tag || '-'}\")\n puts\n end\n end\nend\n"}}]},{"html_id":"procodile/Procodile/Supervisor","path":"Procodile/Supervisor.html","kind":"class","full_name":"Procodile::Supervisor","name":"Supervisor","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/supervisor.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L9"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(config:Procodile::Config,run_options:Procodile::RunOptions=Procodile::RunOptions.new)-class-method","name":"new","abstract":false,"args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"args_string":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","args_html":"(config : Procodile::Config, run_options : Procodile::RunOptions = Procodile::RunOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L15"},"def":{"name":"new","args":[{"name":"config","external_name":"config","restriction":"Procodile::Config"},{"name":"run_options","default_value":"Procodile::RunOptions.new","external_name":"run_options","restriction":"::Procodile::RunOptions"}],"visibility":"Public","body":"_ = allocate\n_.initialize(config, run_options)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_instance(instance,io=nil)-instance-method","name":"add_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"args_string":"(instance, io = nil)","args_html":"(instance, io = nil)","location":{"filename":"src/procodile/supervisor.cr","line_number":234,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L234"},"def":{"name":"add_instance","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","default_value":"nil","external_name":"io","restriction":""}],"visibility":"Public","body":"if io\n add_reader(instance, io)\nend\n__temp_44 = instance.process\n@processes[__temp_44]? || (@processes[__temp_44] = [] of Procodile::Instance)\nif @processes[instance.process].includes?(instance)\nelse\n @processes[instance.process] << instance\nend\n"}},{"html_id":"add_reader(instance,io)-instance-method","name":"add_reader","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"args_string":"(instance, io)","args_html":"(instance, io)","location":{"filename":"src/procodile/supervisor.cr","line_number":229,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L229"},"def":{"name":"add_reader","args":[{"name":"instance","external_name":"instance","restriction":""},{"name":"io","external_name":"io","restriction":""}],"visibility":"Public","body":"@readers[io] = instance\n@signal_handler.notice\n"}},{"html_id":"allow_respawning?:Bool-instance-method","name":"allow_respawning?","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":27,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L27"},"def":{"name":"allow_respawning?","return_type":"Bool","visibility":"Public","body":"@run_options.respawn != false"}},{"html_id":"check_concurrency(options={}ofString=>String):Hash(Symbol,Array(Procodile::Instance))-instance-method","name":"check_concurrency","abstract":false,"args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"args_string":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","args_html":"(options = {} of String => String) : Hash(Symbol, Array(Procodile::Instance))","location":{"filename":"src/procodile/supervisor.cr","line_number":175,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L175"},"def":{"name":"check_concurrency","args":[{"name":"options","default_value":"{} of String => String","external_name":"options","restriction":""}],"return_type":"Hash(Symbol, Array(Procodile::Instance))","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Checking process concurrency\")\nif options.reload == false\nelse\n reload_config\nend\nresult = check_instance_quantities\nif result[:started].empty? && result[:stopped].empty?\n Procodile.log(nil, \"system\", \"Process concurrency looks good\")\nelse\n if result[:started].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check started #{result[:started].map(&.description).join(\", \")}\")\n end\n if result[:stopped].empty?\n else\n Procodile.log(nil, \"system\", \"Concurrency check stopped #{result[:stopped].map(&.description).join(\", \")}\")\n end\nend\nresult\n"}},{"html_id":"config:Procodile::Config-instance-method","name":"config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"config","visibility":"Public","body":"@config"}},{"html_id":"messages:Array(SupervisorMessages)-instance-method","name":"messages","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":203,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L203"},"def":{"name":"messages","return_type":"Array(SupervisorMessages)","visibility":"Public","body":"messages = [] of SupervisorMessages\nprocesses.each do |process, process_instances|\n if process.correct_quantity?(process_instances.size)\n else\n messages << SupervisorMessages.new(type: \"incorrect_quantity\", process: process.name, current: process_instances.size, desired: process.quantity)\n end\n process_instances.each do |instance|\n if instance.should_be_running? && (instance.status != \"Running\")\n messages << SupervisorMessages.new(type: \"not_running\", instance: instance.description, status: instance.status)\n end\n end\nend\nmessages\n"}},{"html_id":"processes:Hash(Procodile::Process,Array(Procodile::Instance))-instance-method","name":"processes","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"processes","visibility":"Public","body":"@processes"}},{"html_id":"reload_config-instance-method","name":"reload_config","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L170"},"def":{"name":"reload_config","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Reloading configuration\")\n@config.reload\n"}},{"html_id":"remove_instance(instance)-instance-method","name":"remove_instance","abstract":false,"args":[{"name":"instance","external_name":"instance","restriction":""}],"args_string":"(instance)","args_html":"(instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":242,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L242"},"def":{"name":"remove_instance","args":[{"name":"instance","external_name":"instance","restriction":""}],"visibility":"Public","body":"if @processes[instance.process]\n @processes[instance.process].delete(instance)\n @readers.delete(instance)\nend"}},{"html_id":"restart(options=SupervisorOptions.new)-instance-method","name":"restart","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new)","args_html":"(options = SupervisorOptions.new)","location":{"filename":"src/procodile/supervisor.cr","line_number":110,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L110"},"def":{"name":"restart","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_restarted = [] of Array(Procodile::Instance | ::Nil)\nprocesses = options.processes\nif processes.nil?\n Procodile.log(nil, \"system\", \"Restarting all #{@config.app_name} processes\")\n instances = @processes.values.flatten\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Restarting #{instances.size} process(es)\")\nend\nstopped = (check_instance_quantities(:stopped, processes))[:stopped].map do |i|\n [i, nil]\nend\ninstances_restarted.concat(stopped)\ninstances.each do |instance|\n if instance.stopping?\n next\n end\n new_instance = instance.restart\n instances_restarted << [instance, new_instance]\nend\nchecked = (check_instance_quantities(:started, processes))[:started].map do |i|\n [nil, i]\nend\ninstances_restarted.concat(checked)\ninstances_restarted\n"}},{"html_id":"run_options:Procodile::RunOptions-instance-method","name":"run_options","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"run_options","visibility":"Public","body":"@run_options"}},{"html_id":"start(after_start:Proc(Procodile::Supervisor,Nil))-instance-method","name":"start","abstract":false,"args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"args_string":"(after_start : Proc(Procodile::Supervisor, Nil))","args_html":"(after_start : Proc(Procodile::Supervisor, Nil))","location":{"filename":"src/procodile/supervisor.cr","line_number":31,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L31"},"def":{"name":"start","args":[{"name":"after_start","external_name":"after_start","restriction":"Proc(Procodile::Supervisor, Nil)"}],"visibility":"Public","body":"begin\n Procodile.log(nil, \"system\", \"Procodile supervisor started with PID #{::Process.pid}\")\n Procodile.log(nil, \"system\", \"Application root is #{@config.root}\")\n if @run_options.respawn == false\n Procodile.log(nil, \"system\", \"Automatic respawning is disabled\")\n end\n ControlServer.start(self)\n if @run_options.proxy\n Procodile.log(nil, \"system\", \"Proxy is enabled\")\n @tcp_proxy = TCPProxy.start(self)\n end\n watch_for_output\n @started_at = Time.local\n after_start.call(self)\nrescue e\n Procodile.log(nil, \"system\", \"Error: #{e.class} (#{e.message})\")\n e.backtrace.each do |bt|\n Procodile.log(nil, \"system\", \"=> #{bt})\")\n end\n stop(SupervisorOptions.new(stop_supervisor: true))\nensure\n loop do\n supervise\n sleep(3)\n end\nend"}},{"html_id":"start_processes(process_names:Array(String)|Nil,options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"start_processes","abstract":false,"args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(process_names : Array(String) | Nil, options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":61,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L61"},"def":{"name":"start_processes","args":[{"name":"process_names","external_name":"process_names","restriction":"Array(String) | ::Nil"},{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"@tag = options.tag\nreload_config\ninstances_started = [] of Procodile::Instance\n@config.processes.each do |name, process|\n if process_names && (!(process_names.includes?(name.to_s)))\n next\n end\n if @processes[process]? && (!@processes[process].empty?)\n next\n end\n instances = process.generate_instances(self)\n instances.each(&.start)\n instances_started.concat(instances)\nend\ninstances_started\n"}},{"html_id":"started_at:Time?-instance-method","name":"started_at","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"started_at","visibility":"Public","body":"@started_at"}},{"html_id":"stop(options=SupervisorOptions.new):Array(Procodile::Instance)-instance-method","name":"stop","abstract":false,"args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"args_string":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","args_html":"(options = SupervisorOptions.new) : Array(Procodile::Instance)","location":{"filename":"src/procodile/supervisor.cr","line_number":80,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L80"},"def":{"name":"stop","args":[{"name":"options","default_value":"SupervisorOptions.new","external_name":"options","restriction":""}],"return_type":"Array(Procodile::Instance)","visibility":"Public","body":"if options.stop_supervisor\n @run_options.stop_when_none = true\nend\nreload_config\nprocesses = options.processes\ninstances_stopped = [] of Procodile::Instance\nif processes.nil?\n Procodile.log(nil, \"system\", \"Stopping all #{@config.app_name} processes\")\n @processes.each do |_, instances|\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\n end\nelse\n instances = process_names_to_instances(processes)\n Procodile.log(nil, \"system\", \"Stopping #{instances.size} process(es)\")\n instances.each do |instance|\n instance.stop\n instances_stopped << instance\n end\nend\ninstances_stopped\n"}},{"html_id":"stop_supervisor-instance-method","name":"stop_supervisor","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":145,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L145"},"def":{"name":"stop_supervisor","visibility":"Public","body":"Procodile.log(nil, \"system\", \"Stopping Procodile supervisor\")\nFileUtils.rm_rf(File.join(@config.pid_root, \"procodile.pid\"))\n::Process.exit(0)\n"}},{"html_id":"supervise-instance-method","name":"supervise","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":151,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L151"},"def":{"name":"supervise","visibility":"Public","body":"remove_stopped_instances\nremove_removed_processes\n@processes.each do |_, instances|\n instances.each(&.check)\nend\nif @run_options.stop_when_none && @processes.all? do |_, instances|\n instances.reject(&.failed?).empty?\nend\n Procodile.log(nil, \"system\", \"All processes have stopped\")\n stop_supervisor\nend\n"}},{"html_id":"tag:String?-instance-method","name":"tag","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"tag","visibility":"Public","body":"@tag"}},{"html_id":"tcp_proxy:Procodile::TCPProxy?-instance-method","name":"tcp_proxy","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":13,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L13"},"def":{"name":"tcp_proxy","visibility":"Public","body":"@tcp_proxy"}},{"html_id":"to_hash-instance-method","name":"to_hash","abstract":false,"location":{"filename":"src/procodile/supervisor.cr","line_number":196,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/supervisor.cr#L196"},"def":{"name":"to_hash","visibility":"Public","body":"{started_at: @started_at.not_nil!.to_unix, pid: ::Process.pid}"}}]},{"html_id":"procodile/Procodile/SupervisorMessages","path":"Procodile/SupervisorMessages.html","kind":"struct","full_name":"Procodile::SupervisorMessages","name":"SupervisorMessages","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"},{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/JSON/Serializable","kind":"module","full_name":"JSON::Serializable","name":"Serializable"}],"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(type:String,process:String|Nil=nil,current:Int32|Nil=nil,desired:Int32|Nil=nil,instance:String|Nil=nil,status:String|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"args_string":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","args_html":"(type : String, process : String | Nil = nil, current : Int32 | Nil = nil, desired : Int32 | Nil = nil, instance : String | Nil = nil, status : String | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"new","args":[{"name":"type","external_name":"type","restriction":"String"},{"name":"process","default_value":"nil","external_name":"process","restriction":"String | ::Nil"},{"name":"current","default_value":"nil","external_name":"current","restriction":"Int32 | ::Nil"},{"name":"desired","default_value":"nil","external_name":"desired","restriction":"Int32 | ::Nil"},{"name":"instance","default_value":"nil","external_name":"instance","restriction":"String | ::Nil"},{"name":"status","default_value":"nil","external_name":"status","restriction":"String | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(type, process, current, desired, instance, status)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"html_id":"new(pull:JSON::PullParser)-class-method","name":"new","abstract":false,"args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"args_string":"(pull : JSON::PullParser)","args_html":"(pull : JSON::PullParser)","location":{"filename":"src/procodile/procfile_option.cr","line_number":147,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L147"},"def":{"name":"new","args":[{"name":"pull","external_name":"pull","restriction":"::JSON::PullParser"}],"visibility":"Public","body":"new_from_json_pull_parser(pull)"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@type.clone, @process.clone, @current.clone, @desired.clone, @instance.clone, @status.clone)"}},{"html_id":"copy_with(type_type=@type,process_process=@process,current_current=@current,desired_desired=@desired,instance_instance=@instance,status_status=@status)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"args_string":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","args_html":"(type _type = @type, process _process = @process, current _current = @current, desired _desired = @desired, instance _instance = @instance, status _status = @status)","location":{"filename":"src/procodile/procfile_option.cr","line_number":140,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L140"},"def":{"name":"copy_with","args":[{"name":"_type","default_value":"@type","external_name":"type","restriction":""},{"name":"_process","default_value":"@process","external_name":"process","restriction":""},{"name":"_current","default_value":"@current","external_name":"current","restriction":""},{"name":"_desired","default_value":"@desired","external_name":"desired","restriction":""},{"name":"_instance","default_value":"@instance","external_name":"instance","restriction":""},{"name":"_status","default_value":"@status","external_name":"status","restriction":""}],"visibility":"Public","body":"self.class.new(_type, _process, _current, _desired, _instance, _status)"}},{"html_id":"current:Int32|Nil-instance-method","name":"current","abstract":false,"def":{"name":"current","return_type":"Int32 | ::Nil","visibility":"Public","body":"@current"}},{"html_id":"desired:Int32|Nil-instance-method","name":"desired","abstract":false,"def":{"name":"desired","return_type":"Int32 | ::Nil","visibility":"Public","body":"@desired"}},{"html_id":"instance:String|Nil-instance-method","name":"instance","abstract":false,"def":{"name":"instance","return_type":"String | ::Nil","visibility":"Public","body":"@instance"}},{"html_id":"process:String|Nil-instance-method","name":"process","abstract":false,"def":{"name":"process","return_type":"String | ::Nil","visibility":"Public","body":"@process"}},{"html_id":"status:String|Nil-instance-method","name":"status","abstract":false,"def":{"name":"status","return_type":"String | ::Nil","visibility":"Public","body":"@status"}},{"html_id":"type:String-instance-method","name":"type","abstract":false,"def":{"name":"type","return_type":"String","visibility":"Public","body":"@type"}}]},{"html_id":"procodile/Procodile/SupervisorOptions","path":"Procodile/SupervisorOptions.html","kind":"struct","full_name":"Procodile::SupervisorOptions","name":"SupervisorOptions","abstract":false,"superclass":{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"procodile/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"procodile/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"constructors":[{"html_id":"new(processes:Array(String)|Nil=nil,stop_supervisor:Bool|Nil=nil,tag:String|Nil=nil,reload:Bool|Nil=nil)-class-method","name":"new","abstract":false,"args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"args_string":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","args_html":"(processes : Array(String) | Nil = nil, stop_supervisor : Bool | Nil = nil, tag : String | Nil = nil, reload : Bool | Nil = nil)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"new","args":[{"name":"processes","default_value":"nil","external_name":"processes","restriction":"Array(String) | ::Nil"},{"name":"stop_supervisor","default_value":"nil","external_name":"stop_supervisor","restriction":"Bool | ::Nil"},{"name":"tag","default_value":"nil","external_name":"tag","restriction":"String | ::Nil"},{"name":"reload","default_value":"nil","external_name":"reload","restriction":"Bool | ::Nil"}],"visibility":"Public","body":"_ = allocate\n_.initialize(processes, stop_supervisor, tag, reload)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"clone-instance-method","name":"clone","abstract":false,"location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"clone","visibility":"Public","body":"self.class.new(@processes.clone, @stop_supervisor.clone, @tag.clone, @reload.clone)"}},{"html_id":"copy_with(processes_processes=@processes,stop_supervisor_stop_supervisor=@stop_supervisor,tag_tag=@tag,reload_reload=@reload)-instance-method","name":"copy_with","abstract":false,"args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"args_string":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","args_html":"(processes _processes = @processes, stop_supervisor _stop_supervisor = @stop_supervisor, tag _tag = @tag, reload _reload = @reload)","location":{"filename":"src/procodile/procfile_option.cr","line_number":170,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/procfile_option.cr#L170"},"def":{"name":"copy_with","args":[{"name":"_processes","default_value":"@processes","external_name":"processes","restriction":""},{"name":"_stop_supervisor","default_value":"@stop_supervisor","external_name":"stop_supervisor","restriction":""},{"name":"_tag","default_value":"@tag","external_name":"tag","restriction":""},{"name":"_reload","default_value":"@reload","external_name":"reload","restriction":""}],"visibility":"Public","body":"self.class.new(_processes, _stop_supervisor, _tag, _reload)"}},{"html_id":"processes:Array(String)|Nil-instance-method","name":"processes","abstract":false,"def":{"name":"processes","return_type":"Array(String) | ::Nil","visibility":"Public","body":"@processes"}},{"html_id":"reload:Bool|Nil-instance-method","name":"reload","abstract":false,"def":{"name":"reload","return_type":"Bool | ::Nil","visibility":"Public","body":"@reload"}},{"html_id":"stop_supervisor:Bool|Nil-instance-method","name":"stop_supervisor","abstract":false,"def":{"name":"stop_supervisor","return_type":"Bool | ::Nil","visibility":"Public","body":"@stop_supervisor"}},{"html_id":"tag:String|Nil-instance-method","name":"tag","abstract":false,"def":{"name":"tag","return_type":"String | ::Nil","visibility":"Public","body":"@tag"}}]},{"html_id":"procodile/Procodile/TCPProxy","path":"Procodile/TCPProxy.html","kind":"class","full_name":"Procodile::TCPProxy","name":"TCPProxy","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/tcp_proxy.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L2"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"procodile/Procodile","kind":"module","full_name":"Procodile","name":"Procodile"},"class_methods":[{"html_id":"start(supervisor)-class-method","name":"start","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"args_string":"(supervisor)","args_html":"(supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":3,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L3"},"def":{"name":"start","args":[{"name":"supervisor","external_name":"supervisor","restriction":""}],"visibility":"Public","body":"proxy = new(supervisor)\nproxy.start\nproxy\n"}}],"constructors":[{"html_id":"new(supervisor:Procodile::Supervisor)-class-method","name":"new","abstract":false,"args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"args_string":"(supervisor : Procodile::Supervisor)","args_html":"(supervisor : Procodile::Supervisor)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":9,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L9"},"def":{"name":"new","args":[{"name":"supervisor","external_name":"supervisor","restriction":"Procodile::Supervisor"}],"visibility":"Public","body":"_ = allocate\n_.initialize(supervisor)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"html_id":"add_process(process)-instance-method","name":"add_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":23,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L23"},"def":{"name":"add_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"begin\n if process.proxy?\n @listeners[TCPServer.new(process.proxy_address.not_nil!, process.proxy_port.not_nil!)] = process\n Procodile.log(nil, \"proxy\", \"Proxying traffic on #{process.proxy_address}:#{process.proxy_port} to #{process.name}\".color(32))\n @sp_writer.write(\".\".to_slice)\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nend"}},{"html_id":"handle_client(client,server)-instance-method","name":"handle_client","abstract":false,"args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"args_string":"(client, server)","args_html":"(client, server)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":86,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L86"},"def":{"name":"handle_client","args":[{"name":"client","external_name":"client","restriction":""},{"name":"server","external_name":"server","restriction":""}],"visibility":"Public","body":"begin\n process = @listeners[server]\n instances = @supervisor.processes[process]? || ([] of Procodile::Instance)\n if instances.empty?\n Procodile.log(nil, \"proxy\", \"There are no processes running for #{process.name}\")\n else\n instance = instances[rand(instances.size)]\n backend_socket = begin\n TCPSocket.new(\"127.0.0.1\", instance.port)\n rescue\n nil\n end\n if backend_socket.nil?\n Procodile.log(nil, \"proxy\", \"Could not connect to #{instance.description}:#{instance.port}\")\n return\n end\n readers = {:backend => backend_socket, :client => client}\n sleep_chan = Channel(Nil).new\n readers_chan = Channel(Nil).new\n spawn do\n loop do\n sleep(0.5)\n sleep_chan.send(nil)\n end\n end\n readers.values.each do |socket|\n spawn do\n loop do\n key = readers.key_for(socket)\n opposite_side = key == (:client) ? :backend : :client\n if socket.read_byte\n readers.delete(opposite_side)\n else\n begin\n readers[opposite_side].write(Bytes.new(socket.read(Bytes.new(1024))))\n rescue\n nil\n end\n end\n readers_chan.send(nil)\n end\n end\n end\n loop do\n select\nwhen readers_chan.receive\nwhen sleep_chan.receive\nend\n\n end\n end\nrescue e\n Procodile.log(nil, \"proxy\", \"Exception: #{e.class}: #{e.message}\")\n Procodile.log(nil, \"proxy\", e.backtrace[0, 5].join(\"\\n\"))\nensure\n if backend_socket\n backend_socket.close\n end\n if client\n client.close\n end\nend"}},{"html_id":"listen-instance-method","name":"listen","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":39,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L39"},"def":{"name":"listen","visibility":"Public","body":"sleep_chan = Channel(Nil).new\nsp_reader_chan = Channel(Nil).new\nlistener_chan = Channel(Nil).new\nspawn do\n loop do\n sleep(30)\n sleep_chan.send(nil)\n end\nend\nspawn do\n loop do\n @sp_reader.read(Bytes.new(999))\n sp_reader_chan.send(nil)\n end\nend\n@listeners.keys.each do |io|\n spawn do\n loop do\n handle_client(client: io.accept, server: io)\n listener_chan.send(nil)\n end\n end\nend\nloop do\n select\nwhen sp_reader_chan.receive\nwhen listener_chan.receive\nwhen sleep_chan.receive\nend\n\n @stopped_processes.reject do |process|\n if ( io = @listeners.key_for(process))\n Procodile.log(nil, \"proxy\", \"Stopped proxy listener for #{process.name}\")\n io.close\n @listeners.delete(io)\n end\n true\n end\nend\n"}},{"html_id":"remove_process(process)-instance-method","name":"remove_process","abstract":false,"args":[{"name":"process","external_name":"process","restriction":""}],"args_string":"(process)","args_html":"(process)","location":{"filename":"src/procodile/tcp_proxy.cr","line_number":34,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L34"},"def":{"name":"remove_process","args":[{"name":"process","external_name":"process","restriction":""}],"visibility":"Public","body":"@stopped_processes << process\n@sp_writer.write(\".\".to_slice)\n"}},{"html_id":"start-instance-method","name":"start","abstract":false,"location":{"filename":"src/procodile/tcp_proxy.cr","line_number":15,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/tcp_proxy.cr#L15"},"def":{"name":"start","visibility":"Public","body":"@supervisor.config.processes.each do |_, p|\n add_process(p)\nend\nspawn do\n listen\n Procodile.log(nil, \"proxy\", \"Stopped listening on all ports\")\nend\n"}}]}]},{"html_id":"procodile/String","path":"String.html","kind":"class","full_name":"String","name":"String","abstract":false,"superclass":{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"},{"html_id":"procodile/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"procodile/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/procodile/color.cr","line_number":1,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/color.cr#L1"}],"repository_name":"procodile","program":false,"enum":false,"alias":false,"const":false,"included_modules":[{"html_id":"procodile/Comparable","kind":"module","full_name":"Comparable","name":"Comparable"}],"doc":"A `String` represents an immutable sequence of UTF-8 characters.\n\nA `String` is typically created with a string literal, enclosing UTF-8 characters\nin double quotes:\n\n```\n\"hello world\"\n```\n\nSee [`String` literals](https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html) in the language reference.\n\nA backslash can be used to denote some characters inside the string:\n\n```\n\"\\\"\" # double quote\n\"\\\\\" # backslash\n\"\\e\" # escape\n\"\\f\" # form feed\n\"\\n\" # newline\n\"\\r\" # carriage return\n\"\\t\" # tab\n\"\\v\" # vertical tab\n```\n\nYou can use a backslash followed by an *u* and four hexadecimal characters to denote a unicode codepoint written:\n\n```\n\"\\u0041\" # == \"A\"\n```\n\nOr you can use curly braces and specify up to six hexadecimal numbers (0 to 10FFFF):\n\n```\n\"\\u{41}\" # == \"A\"\n```\n\nA string can span multiple lines:\n\n```\n\"hello\n world\" # same as \"hello\\n world\"\n```\n\nNote that in the above example trailing and leading spaces, as well as newlines,\nend up in the resulting string. To avoid this, you can split a string into multiple lines\nby joining multiple literals with a backslash:\n\n```\n\"hello \" \\\n\"world, \" \\\n\"no newlines\" # same as \"hello world, no newlines\"\n```\n\nAlternatively, a backslash followed by a newline can be inserted inside the string literal:\n\n```\n\"hello \\\n world, \\\n no newlines\" # same as \"hello world, no newlines\"\n```\n\nIn this case, leading whitespace is not included in the resulting string.\n\nIf you need to write a string that has many double quotes, parentheses, or similar\ncharacters, you can use alternative literals:\n\n```\n# Supports double quotes and nested parentheses\n%(hello (\"world\")) # same as \"hello (\\\"world\\\")\"\n\n# Supports double quotes and nested brackets\n%[hello [\"world\"]] # same as \"hello [\\\"world\\\"]\"\n\n# Supports double quotes and nested curlies\n%{hello {\"world\"}} # same as \"hello {\\\"world\\\"}\"\n\n# Supports double quotes and nested angles\n%> # same as \"hello <\\\"world\\\">\"\n```\n\nTo create a `String` with embedded expressions, you can use string interpolation:\n\n```\na = 1\nb = 2\n\"sum = #{a + b}\" # \"sum = 3\"\n```\n\nThis ends up invoking `Object#to_s(IO)` on each expression enclosed by `#{...}`.\n\nIf you need to dynamically build a string, use `String#build` or `IO::Memory`.\n\n### Non UTF-8 valid strings\n\nString might end up being conformed of bytes which are an invalid\nbyte sequence according to UTF-8. This can happen if the string is created\nvia one of the constructors that accept bytes, or when getting a string\nfrom `String.build` or `IO::Memory`. No exception will be raised, but\ninvalid byte sequences, when asked as chars, will use the unicode replacement\nchar (value 0xFFFD). For example:\n\n```\n# here 255 is not a valid byte value in the UTF-8 encoding\nstring = String.new(Bytes[255, 97])\nstring.valid_encoding? # => false\n\n# The first char here is the unicode replacement char\nstring.chars # => ['�', 'a']\n```\n\nOne can also create strings with specific byte value in them by\nusing octal and hexadecimal escape sequences:\n\n```\n# Octal escape sequences\n\"\\101\" # # => \"A\"\n\"\\12\" # # => \"\\n\"\n\"\\1\" # string with one character with code point 1\n\"\\377\" # string with one byte with value 255\n\n# Hexadecimal escape sequences\n\"\\x41\" # # => \"A\"\n\"\\xFF\" # string with one byte with value 255\n```\n\nThe reason for allowing strings that don't have a valid UTF-8 sequence\nis that the world is full of content that isn't properly encoded,\nand having a program raise an exception or stop because of this\nis not good. It's better if programs are more resilient, but\nshow a replacement character when there's an error in incoming data.","summary":"

A String represents an immutable sequence of UTF-8 characters.

","instance_methods":[{"html_id":"color(color)-instance-method","name":"color","abstract":false,"args":[{"name":"color","external_name":"color","restriction":""}],"args_string":"(color)","args_html":"(color)","location":{"filename":"src/procodile/color.cr","line_number":2,"url":"https://github.com/crystal-china/procodile_cr/blob/fb080234a8f1f9c7fd966693ec11b70cf8472817/src/procodile/color.cr#L2"},"def":{"name":"color","args":[{"name":"color","external_name":"color","restriction":""}],"visibility":"Public","body":"\"\\e[#{color}m#{self}\\e[0m\""}}]}]}}) \ No newline at end of file diff --git a/toplevel.html b/toplevel.html index 8a86a67..ae82c28 100644 --- a/toplevel.html +++ b/toplevel.html @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - Top Level Namespace - procodile 1.0.19 + Top Level Namespace - procodile master @@ -39,7 +39,7 @@

- 1.0.19 + master