passenger 3.0.0.pre4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/bin/passenger-install-apache2-module +6 -6
- data/doc/Users guide Apache.html +1 -1
- data/doc/Users guide Nginx.html +1 -1
- data/doc/Users guide Standalone.html +1 -1
- data/doc/cxxapi/Constants_8h_source.html +1 -1
- data/doc/cxxapi/MessageServer_8h_source.html +416 -410
- data/doc/rdoc/classes/ConditionVariable.html +215 -0
- data/doc/rdoc/classes/Exception.html +120 -0
- data/doc/rdoc/classes/GC.html +113 -0
- data/doc/rdoc/classes/IO.html +221 -0
- data/doc/rdoc/classes/PhusionPassenger.html +397 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +180 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +647 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +654 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +97 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +96 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +97 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +96 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +619 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +142 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +368 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +231 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +588 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +147 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +279 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +123 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +341 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +294 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +199 -0
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +155 -0
- data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +367 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +95 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +351 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +200 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +410 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +156 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +115 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +202 -0
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +172 -0
- data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +273 -0
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +145 -0
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +162 -0
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +141 -0
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +673 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +415 -0
- data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +134 -0
- data/doc/rdoc/classes/PhusionPassenger/Packaging.html +129 -0
- data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +1809 -0
- data/doc/rdoc/classes/PhusionPassenger/Plugin.html +237 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +312 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +218 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +114 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +256 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +139 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +118 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +135 -0
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +378 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone.html +111 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +252 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +161 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +368 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +132 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +151 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +189 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +177 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +341 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +203 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +156 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +168 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +86 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +135 -0
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +125 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +1550 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +204 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +171 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +140 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +260 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +169 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +265 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +120 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +561 -0
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +140 -0
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +182 -0
- data/doc/rdoc/classes/Process.html +115 -0
- data/doc/rdoc/classes/Signal.html +139 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/DEVELOPERS_TXT.html +276 -0
- data/doc/rdoc/files/README.html +157 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +130 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +135 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +128 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +141 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +146 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +125 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +147 -0
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +120 -0
- data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +128 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +137 -0
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +125 -0
- data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +160 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +135 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +133 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +136 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +120 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +100 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +179 -0
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +132 -0
- data/doc/rdoc/fr_class_index.html +138 -0
- data/doc/rdoc/fr_file_index.html +108 -0
- data/doc/rdoc/fr_method_index.html +430 -0
- data/doc/rdoc/index.html +26 -0
- data/doc/rdoc/rdoc-style.css +187 -0
- data/ext/apache2/HelperAgent.cpp +7 -1
- data/ext/common/Constants.h +1 -1
- data/ext/common/MessageServer.h +7 -1
- data/ext/nginx/StaticContentHandler.c +5 -13
- data/lib/phusion_passenger.rb +2 -2
- data/lib/phusion_passenger/standalone/start_command.rb +6 -6
- data/lib/phusion_passenger/templates/standalone/config.erb +2 -2
- metadata +168 -12
- data/ext/libev/config.h +0 -122
@@ -0,0 +1,237 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
<title>Class: PhusionPassenger::Plugin</title>
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
+
|
11
|
+
<script language="JavaScript" type="text/javascript">
|
12
|
+
// <![CDATA[
|
13
|
+
|
14
|
+
function toggleSource( id )
|
15
|
+
{
|
16
|
+
var elem
|
17
|
+
var link
|
18
|
+
|
19
|
+
if( document.getElementById )
|
20
|
+
{
|
21
|
+
elem = document.getElementById( id )
|
22
|
+
link = document.getElementById( "l_" + id )
|
23
|
+
}
|
24
|
+
else if ( document.all )
|
25
|
+
{
|
26
|
+
elem = eval( "document.all." + id )
|
27
|
+
link = eval( "document.all.l_" + id )
|
28
|
+
}
|
29
|
+
else
|
30
|
+
return false;
|
31
|
+
|
32
|
+
if( elem.style.display == "block" )
|
33
|
+
{
|
34
|
+
elem.style.display = "none"
|
35
|
+
link.innerHTML = "show source"
|
36
|
+
}
|
37
|
+
else
|
38
|
+
{
|
39
|
+
elem.style.display = "block"
|
40
|
+
link.innerHTML = "hide source"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
function openCode( url )
|
45
|
+
{
|
46
|
+
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
+
}
|
48
|
+
// ]]>
|
49
|
+
</script>
|
50
|
+
</head>
|
51
|
+
|
52
|
+
<body>
|
53
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
+
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Plugin</td>
|
55
|
+
<td align="right">
|
56
|
+
<table cellspacing="0" cellpadding="2">
|
57
|
+
<tr valign="top">
|
58
|
+
<td>In:</td>
|
59
|
+
<td>
|
60
|
+
<a href="../../files/lib/phusion_passenger/plugin_rb.html">lib/phusion_passenger/plugin.rb</a>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>Parent:</td>
|
65
|
+
<td>
|
66
|
+
Object
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
</table>
|
70
|
+
</td>
|
71
|
+
</tr>
|
72
|
+
</table>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
<div id="content">
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div class="sectiontitle">Methods</div>
|
82
|
+
<ul>
|
83
|
+
<li><a href="#M000348">call_hook</a></li>
|
84
|
+
<li><a href="#M000345">call_hook</a></li>
|
85
|
+
<li><a href="#M000343">load</a></li>
|
86
|
+
<li><a href="#M000347">new</a></li>
|
87
|
+
<li><a href="#M000346">register</a></li>
|
88
|
+
<li><a href="#M000344">register_hook</a></li>
|
89
|
+
</ul>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<div class="sectiontitle">Public Class methods</div>
|
97
|
+
<div class="method">
|
98
|
+
<div class="title">
|
99
|
+
<a name="M000345"></a><b>call_hook</b>(name, *args, &block)
|
100
|
+
</div>
|
101
|
+
<div class="sourcecode">
|
102
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000345_source')" id="l_M000345_source">show source</a> ]</p>
|
103
|
+
<div id="M000345_source" class="dyn-source">
|
104
|
+
<pre>
|
105
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 56</span>
|
106
|
+
56: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">call_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
107
|
+
57: <span class="ruby-identifier">last_result</span> = <span class="ruby-keyword kw">nil</span>
|
108
|
+
58: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">hooks_list</span> = <span class="ruby-ivar">@@hooks</span>[<span class="ruby-identifier">name</span>])
|
109
|
+
59: <span class="ruby-identifier">hooks_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span><span class="ruby-operator">|</span>
|
110
|
+
60: <span class="ruby-identifier">last_result</span> = <span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
111
|
+
61: <span class="ruby-keyword kw">end</span>
|
112
|
+
62: <span class="ruby-keyword kw">end</span>
|
113
|
+
63: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">last_result</span>
|
114
|
+
64: <span class="ruby-keyword kw">end</span>
|
115
|
+
</pre>
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
<div class="method">
|
120
|
+
<div class="title">
|
121
|
+
<a name="M000343"></a><b>load</b>(name, load_once = true)
|
122
|
+
</div>
|
123
|
+
<div class="sourcecode">
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000343_source')" id="l_M000343_source">show source</a> ]</p>
|
125
|
+
<div id="M000343_source" class="dyn-source">
|
126
|
+
<pre>
|
127
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 33</span>
|
128
|
+
33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">load_once</span> = <span class="ruby-keyword kw">true</span>)
|
129
|
+
34: <span class="ruby-constant">PLUGIN_DIRS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin_dir</span><span class="ruby-operator">|</span>
|
130
|
+
35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plugin_dir</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A~/</span>
|
131
|
+
36: <span class="ruby-comment cmt"># File.expand_path uses ENV['HOME'] which we don't want.</span>
|
132
|
+
37: <span class="ruby-identifier">home</span> = <span class="ruby-constant">Etc</span>.<span class="ruby-identifier">getpwuid</span>(<span class="ruby-constant">Process</span>.<span class="ruby-identifier">uid</span>).<span class="ruby-identifier">dir</span>
|
133
|
+
38: <span class="ruby-identifier">plugin_dir</span> = <span class="ruby-identifier">plugin_dir</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\A~/</span>, <span class="ruby-identifier">home</span>)
|
134
|
+
39: <span class="ruby-keyword kw">end</span>
|
135
|
+
40: <span class="ruby-identifier">plugin_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">plugin_dir</span>)
|
136
|
+
41: <span class="ruby-constant">Dir</span>[<span class="ruby-node">"#{plugin_dir}/*/#{name}.rb"</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
|
137
|
+
42: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">load_once</span>
|
138
|
+
43: <span class="ruby-identifier">require</span>(<span class="ruby-identifier">filename</span>)
|
139
|
+
44: <span class="ruby-keyword kw">else</span>
|
140
|
+
45: <span class="ruby-identifier">load</span>(<span class="ruby-identifier">filename</span>)
|
141
|
+
46: <span class="ruby-keyword kw">end</span>
|
142
|
+
47: <span class="ruby-keyword kw">end</span>
|
143
|
+
48: <span class="ruby-keyword kw">end</span>
|
144
|
+
49: <span class="ruby-keyword kw">end</span>
|
145
|
+
</pre>
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
<div class="method">
|
150
|
+
<div class="title">
|
151
|
+
<a name="M000347"></a><b>new</b>(name, *args, &block)
|
152
|
+
</div>
|
153
|
+
<div class="sourcecode">
|
154
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000347_source')" id="l_M000347_source">show source</a> ]</p>
|
155
|
+
<div id="M000347_source" class="dyn-source">
|
156
|
+
<pre>
|
157
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 71</span>
|
158
|
+
71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
159
|
+
72: <span class="ruby-constant">Plugin</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">name</span>)
|
160
|
+
73: <span class="ruby-identifier">classes</span> = <span class="ruby-ivar">@@classes</span>[<span class="ruby-identifier">name</span>]
|
161
|
+
74: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">classes</span>
|
162
|
+
75: <span class="ruby-ivar">@instances</span> = <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">klass</span><span class="ruby-operator">|</span>
|
163
|
+
76: <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
164
|
+
77: <span class="ruby-keyword kw">end</span>
|
165
|
+
78: <span class="ruby-keyword kw">else</span>
|
166
|
+
79: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
167
|
+
80: <span class="ruby-keyword kw">end</span>
|
168
|
+
81: <span class="ruby-keyword kw">end</span>
|
169
|
+
</pre>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
<div class="method">
|
174
|
+
<div class="title">
|
175
|
+
<a name="M000346"></a><b>register</b>(name, klass)
|
176
|
+
</div>
|
177
|
+
<div class="sourcecode">
|
178
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000346_source')" id="l_M000346_source">show source</a> ]</p>
|
179
|
+
<div id="M000346_source" class="dyn-source">
|
180
|
+
<pre>
|
181
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 66</span>
|
182
|
+
66: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">klass</span>)
|
183
|
+
67: <span class="ruby-identifier">classes</span> = (<span class="ruby-ivar">@@classes</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> [])
|
184
|
+
68: <span class="ruby-identifier">classes</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">klass</span>
|
185
|
+
69: <span class="ruby-keyword kw">end</span>
|
186
|
+
</pre>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
<div class="method">
|
191
|
+
<div class="title">
|
192
|
+
<a name="M000344"></a><b>register_hook</b>(name, &block)
|
193
|
+
</div>
|
194
|
+
<div class="sourcecode">
|
195
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000344_source')" id="l_M000344_source">show source</a> ]</p>
|
196
|
+
<div id="M000344_source" class="dyn-source">
|
197
|
+
<pre>
|
198
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 51</span>
|
199
|
+
51: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
200
|
+
52: <span class="ruby-identifier">hooks_list</span> = (<span class="ruby-ivar">@@hooks</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> [])
|
201
|
+
53: <span class="ruby-identifier">hooks_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">block</span>
|
202
|
+
54: <span class="ruby-keyword kw">end</span>
|
203
|
+
</pre>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
<div class="sectiontitle">Public Instance methods</div>
|
208
|
+
<div class="method">
|
209
|
+
<div class="title">
|
210
|
+
<a name="M000348"></a><b>call_hook</b>(name, *args, &block)
|
211
|
+
</div>
|
212
|
+
<div class="sourcecode">
|
213
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000348_source')" id="l_M000348_source">show source</a> ]</p>
|
214
|
+
<div id="M000348_source" class="dyn-source">
|
215
|
+
<pre>
|
216
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/plugin.rb, line 83</span>
|
217
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_hook</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
218
|
+
84: <span class="ruby-identifier">last_result</span> = <span class="ruby-keyword kw">nil</span>
|
219
|
+
85: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@instances</span>
|
220
|
+
86: <span class="ruby-ivar">@instances</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">instance</span><span class="ruby-operator">|</span>
|
221
|
+
87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>)
|
222
|
+
88: <span class="ruby-identifier">last_result</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
223
|
+
89: <span class="ruby-keyword kw">end</span>
|
224
|
+
90: <span class="ruby-keyword kw">end</span>
|
225
|
+
91: <span class="ruby-keyword kw">end</span>
|
226
|
+
92: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">last_result</span>
|
227
|
+
93: <span class="ruby-keyword kw">end</span>
|
228
|
+
</pre>
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
</body>
|
237
|
+
</html>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
<title>Module: PhusionPassenger::Rack</title>
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
+
|
11
|
+
<script language="JavaScript" type="text/javascript">
|
12
|
+
// <![CDATA[
|
13
|
+
|
14
|
+
function toggleSource( id )
|
15
|
+
{
|
16
|
+
var elem
|
17
|
+
var link
|
18
|
+
|
19
|
+
if( document.getElementById )
|
20
|
+
{
|
21
|
+
elem = document.getElementById( id )
|
22
|
+
link = document.getElementById( "l_" + id )
|
23
|
+
}
|
24
|
+
else if ( document.all )
|
25
|
+
{
|
26
|
+
elem = eval( "document.all." + id )
|
27
|
+
link = eval( "document.all.l_" + id )
|
28
|
+
}
|
29
|
+
else
|
30
|
+
return false;
|
31
|
+
|
32
|
+
if( elem.style.display == "block" )
|
33
|
+
{
|
34
|
+
elem.style.display = "none"
|
35
|
+
link.innerHTML = "show source"
|
36
|
+
}
|
37
|
+
else
|
38
|
+
{
|
39
|
+
elem.style.display = "block"
|
40
|
+
link.innerHTML = "hide source"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
function openCode( url )
|
45
|
+
{
|
46
|
+
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
+
}
|
48
|
+
// ]]>
|
49
|
+
</script>
|
50
|
+
</head>
|
51
|
+
|
52
|
+
<body>
|
53
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
+
<td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::Rack</td>
|
55
|
+
<td align="right">
|
56
|
+
<table cellspacing="0" cellpadding="2">
|
57
|
+
<tr valign="top">
|
58
|
+
<td>In:</td>
|
59
|
+
<td>
|
60
|
+
<a href="../../files/lib/phusion_passenger/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
|
61
|
+
<a href="../../files/lib/phusion_passenger/rack/request_handler_rb.html">lib/phusion_passenger/rack/request_handler.rb</a>
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
</table>
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
</table>
|
68
|
+
<!-- banner header -->
|
69
|
+
|
70
|
+
<div id="bodyContent">
|
71
|
+
<div id="content">
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div class="sectiontitle">Classes and Modules</div>
|
80
|
+
Class <a href="Rack/ApplicationSpawner.html" class="link">PhusionPassenger::Rack::ApplicationSpawner</a><br />
|
81
|
+
Class <a href="Rack/RequestHandler.html" class="link">PhusionPassenger::Rack::RequestHandler</a><br />
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
</body>
|
91
|
+
</html>
|
@@ -0,0 +1,312 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
<title>Class: PhusionPassenger::Rack::ApplicationSpawner</title>
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
+
|
11
|
+
<script language="JavaScript" type="text/javascript">
|
12
|
+
// <![CDATA[
|
13
|
+
|
14
|
+
function toggleSource( id )
|
15
|
+
{
|
16
|
+
var elem
|
17
|
+
var link
|
18
|
+
|
19
|
+
if( document.getElementById )
|
20
|
+
{
|
21
|
+
elem = document.getElementById( id )
|
22
|
+
link = document.getElementById( "l_" + id )
|
23
|
+
}
|
24
|
+
else if ( document.all )
|
25
|
+
{
|
26
|
+
elem = eval( "document.all." + id )
|
27
|
+
link = eval( "document.all.l_" + id )
|
28
|
+
}
|
29
|
+
else
|
30
|
+
return false;
|
31
|
+
|
32
|
+
if( elem.style.display == "block" )
|
33
|
+
{
|
34
|
+
elem.style.display = "none"
|
35
|
+
link.innerHTML = "show source"
|
36
|
+
}
|
37
|
+
else
|
38
|
+
{
|
39
|
+
elem.style.display = "block"
|
40
|
+
link.innerHTML = "hide source"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
function openCode( url )
|
45
|
+
{
|
46
|
+
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
+
}
|
48
|
+
// ]]>
|
49
|
+
</script>
|
50
|
+
</head>
|
51
|
+
|
52
|
+
<body>
|
53
|
+
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
+
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Rack::ApplicationSpawner</td>
|
55
|
+
<td align="right">
|
56
|
+
<table cellspacing="0" cellpadding="2">
|
57
|
+
<tr valign="top">
|
58
|
+
<td>In:</td>
|
59
|
+
<td>
|
60
|
+
<a href="../../../files/lib/phusion_passenger/rack/application_spawner_rb.html">lib/phusion_passenger/rack/application_spawner.rb</a>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>Parent:</td>
|
65
|
+
<td>
|
66
|
+
AbstractServer
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
</table>
|
70
|
+
</td>
|
71
|
+
</tr>
|
72
|
+
</table>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
<div id="content">
|
77
|
+
|
78
|
+
<div class="description"><p>
|
79
|
+
Spawning of <a href="../Rack.html">Rack</a> applications.
|
80
|
+
</p>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<div class="sectiontitle">Methods</div>
|
86
|
+
<ul>
|
87
|
+
<li><a href="#M000023">new</a></li>
|
88
|
+
<li><a href="#M000022">spawn_application</a></li>
|
89
|
+
<li><a href="#M000024">spawn_application</a></li>
|
90
|
+
<li><a href="#M000025">start</a></li>
|
91
|
+
</ul>
|
92
|
+
|
93
|
+
<div class="sectiontitle">Included Modules</div>
|
94
|
+
<ul>
|
95
|
+
<li><a href="../Utils.html">Utils</a></li>
|
96
|
+
<li><a href="../DebugLogging.html">DebugLogging</a></li>
|
97
|
+
</ul>
|
98
|
+
|
99
|
+
|
100
|
+
<div class="sectiontitle">Classes and Modules</div>
|
101
|
+
Class <a href="ApplicationSpawner/Error.html" class="link">PhusionPassenger::Rack::ApplicationSpawner::Error</a><br />
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<div class="sectiontitle">Public Class methods</div>
|
107
|
+
<div class="method">
|
108
|
+
<div class="title">
|
109
|
+
<a name="M000023"></a><b>new</b>(options)
|
110
|
+
</div>
|
111
|
+
<div class="description">
|
112
|
+
<p>
|
113
|
+
The following options are accepted:
|
114
|
+
</p>
|
115
|
+
<ul>
|
116
|
+
<li>‘app_root‘
|
117
|
+
|
118
|
+
</li>
|
119
|
+
</ul>
|
120
|
+
<p>
|
121
|
+
See <a
|
122
|
+
href="../SpawnManager.html#M000363">SpawnManager#spawn_application</a> for
|
123
|
+
information about the options.
|
124
|
+
</p>
|
125
|
+
</div>
|
126
|
+
<div class="sourcecode">
|
127
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
|
128
|
+
<div id="M000023_source" class="dyn-source">
|
129
|
+
<pre>
|
130
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 95</span>
|
131
|
+
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
132
|
+
96: <span class="ruby-keyword kw">super</span>()
|
133
|
+
97: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
|
134
|
+
98: <span class="ruby-ivar">@app_root</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value str">"app_root"</span>]
|
135
|
+
99: <span class="ruby-ivar">@canonicalized_app_root</span> = <span class="ruby-identifier">canonicalize_path</span>(<span class="ruby-ivar">@app_root</span>)
|
136
|
+
100: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_idle_time</span> = <span class="ruby-constant">DEFAULT_APP_SPAWNER_MAX_IDLE_TIME</span>
|
137
|
+
101: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
|
138
|
+
102: <span class="ruby-keyword kw">end</span>
|
139
|
+
</pre>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
<div class="method">
|
144
|
+
<div class="title">
|
145
|
+
<a name="M000022"></a><b>spawn_application</b>(options = {})
|
146
|
+
</div>
|
147
|
+
<div class="description">
|
148
|
+
<p>
|
149
|
+
Spawn an instance of the given <a href="../Rack.html">Rack</a> application.
|
150
|
+
When successful, an <a href="../AppProcess.html">AppProcess</a> object will
|
151
|
+
be returned, which represents the spawned application.
|
152
|
+
</p>
|
153
|
+
<p>
|
154
|
+
Accepts the same options as <a
|
155
|
+
href="../SpawnManager.html#M000363">SpawnManager#spawn_application</a>.
|
156
|
+
</p>
|
157
|
+
<p>
|
158
|
+
Raises:
|
159
|
+
</p>
|
160
|
+
<ul>
|
161
|
+
<li><a href="../AppInitError.html">AppInitError</a>: The <a
|
162
|
+
href="../Rack.html">Rack</a> application raised an exception or called
|
163
|
+
exit() during startup.
|
164
|
+
|
165
|
+
</li>
|
166
|
+
<li>SystemCallError, IOError, SocketError: Something went wrong.
|
167
|
+
|
168
|
+
</li>
|
169
|
+
</ul>
|
170
|
+
</div>
|
171
|
+
<div class="sourcecode">
|
172
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000022_source')" id="l_M000022_source">show source</a> ]</p>
|
173
|
+
<div id="M000022_source" class="dyn-source">
|
174
|
+
<pre>
|
175
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 59</span>
|
176
|
+
59: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span> = {})
|
177
|
+
60: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
|
178
|
+
61:
|
179
|
+
62: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
|
180
|
+
63: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">safe_fork</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">true</span>) <span class="ruby-keyword kw">do</span>
|
181
|
+
64: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">close</span>
|
182
|
+
65:
|
183
|
+
66: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fileno</span>]
|
184
|
+
67: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
|
185
|
+
68: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
|
186
|
+
69:
|
187
|
+
70: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>)
|
188
|
+
71: <span class="ruby-identifier">app</span> = <span class="ruby-keyword kw">nil</span>
|
189
|
+
72: <span class="ruby-identifier">success</span> = <span class="ruby-identifier">report_app_init_status</span>(<span class="ruby-identifier">channel</span>) <span class="ruby-keyword kw">do</span>
|
190
|
+
73: <span class="ruby-identifier">prepare_app_process</span>(<span class="ruby-value str">'config.ru'</span>, <span class="ruby-identifier">options</span>)
|
191
|
+
74: <span class="ruby-identifier">app</span> = <span class="ruby-identifier">load_rack_app</span>
|
192
|
+
75: <span class="ruby-identifier">after_loading_app_code</span>(<span class="ruby-identifier">options</span>)
|
193
|
+
76: <span class="ruby-keyword kw">end</span>
|
194
|
+
77: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">success</span>
|
195
|
+
78: <span class="ruby-identifier">start_request_handler</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">app</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">options</span>)
|
196
|
+
79: <span class="ruby-keyword kw">end</span>
|
197
|
+
80: <span class="ruby-keyword kw">end</span>
|
198
|
+
81: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">close</span>
|
199
|
+
82: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
200
|
+
83:
|
201
|
+
84: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">a</span>)
|
202
|
+
85: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value str">"print_exceptions"</span>], <span class="ruby-value str">"rack"</span>)
|
203
|
+
86:
|
204
|
+
87: <span class="ruby-comment cmt"># No exception was raised, so spawning succeeded.</span>
|
205
|
+
88: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">AppProcess</span>.<span class="ruby-identifier">read_from_channel</span>(<span class="ruby-identifier">channel</span>)
|
206
|
+
89: <span class="ruby-keyword kw">end</span>
|
207
|
+
</pre>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
<div class="sectiontitle">Public Instance methods</div>
|
212
|
+
<div class="method">
|
213
|
+
<div class="title">
|
214
|
+
<a name="M000024"></a><b>spawn_application</b>(options = {})
|
215
|
+
</div>
|
216
|
+
<div class="description">
|
217
|
+
<p>
|
218
|
+
Spawns an instance of the <a href="../Rack.html">Rack</a> application. When
|
219
|
+
successful, an <a href="../AppProcess.html">AppProcess</a> object will be
|
220
|
+
returned, which represents the spawned <a href="../Rack.html">Rack</a>
|
221
|
+
application.
|
222
|
+
</p>
|
223
|
+
<p>
|
224
|
+
<tt>options</tt> will be passed to the request handler‘s constructor.
|
225
|
+
</p>
|
226
|
+
<p>
|
227
|
+
Raises:
|
228
|
+
</p>
|
229
|
+
<ul>
|
230
|
+
<li><a
|
231
|
+
href="../AbstractServer/ServerNotStarted.html">AbstractServer::ServerNotStarted</a>:
|
232
|
+
The <a href="ApplicationSpawner.html">ApplicationSpawner</a> server
|
233
|
+
hasn‘t already been started.
|
234
|
+
|
235
|
+
</li>
|
236
|
+
<li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
|
237
|
+
<a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
|
238
|
+
unexpectedly.
|
239
|
+
|
240
|
+
</li>
|
241
|
+
</ul>
|
242
|
+
</div>
|
243
|
+
<div class="sourcecode">
|
244
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000024_source')" id="l_M000024_source">show source</a> ]</p>
|
245
|
+
<div id="M000024_source" class="dyn-source">
|
246
|
+
<pre>
|
247
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 112</span>
|
248
|
+
112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">options</span> = {})
|
249
|
+
113: <span class="ruby-identifier">connect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span>
|
250
|
+
114: <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"spawn_application"</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">flatten</span>)
|
251
|
+
115: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">AppProcess</span>.<span class="ruby-identifier">read_from_channel</span>(<span class="ruby-identifier">channel</span>)
|
252
|
+
116: <span class="ruby-keyword kw">end</span>
|
253
|
+
117: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
254
|
+
118: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">"The application spawner server exited unexpectedly: #{e}"</span>
|
255
|
+
119: <span class="ruby-keyword kw">end</span>
|
256
|
+
</pre>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
<div class="method">
|
261
|
+
<div class="title">
|
262
|
+
<a name="M000025"></a><b>start</b>()
|
263
|
+
</div>
|
264
|
+
<div class="description">
|
265
|
+
<p>
|
266
|
+
Overrided from <a
|
267
|
+
href="../AbstractServer.html#M000325">AbstractServer#start</a>.
|
268
|
+
</p>
|
269
|
+
<p>
|
270
|
+
May raise these additional exceptions:
|
271
|
+
</p>
|
272
|
+
<ul>
|
273
|
+
<li><a href="../AppInitError.html">AppInitError</a>: The <a
|
274
|
+
href="../Rack.html">Rack</a> application raised an exception or called
|
275
|
+
exit() during startup.
|
276
|
+
|
277
|
+
</li>
|
278
|
+
<li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
|
279
|
+
<a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
|
280
|
+
unexpectedly.
|
281
|
+
|
282
|
+
</li>
|
283
|
+
</ul>
|
284
|
+
</div>
|
285
|
+
<div class="sourcecode">
|
286
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
|
287
|
+
<div id="M000025_source" class="dyn-source">
|
288
|
+
<pre>
|
289
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 127</span>
|
290
|
+
127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
|
291
|
+
128: <span class="ruby-keyword kw">super</span>
|
292
|
+
129: <span class="ruby-keyword kw">begin</span>
|
293
|
+
130: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@owner_socket</span>)
|
294
|
+
131: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-ivar">@options</span>[<span class="ruby-value str">"print_exceptions"</span>])
|
295
|
+
132: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
296
|
+
133: <span class="ruby-identifier">stop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
|
297
|
+
134: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">"The application spawner server exited unexpectedly: #{e}"</span>
|
298
|
+
135: <span class="ruby-keyword kw">rescue</span>
|
299
|
+
136: <span class="ruby-identifier">stop</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">started?</span>
|
300
|
+
137: <span class="ruby-identifier">raise</span>
|
301
|
+
138: <span class="ruby-keyword kw">end</span>
|
302
|
+
139: <span class="ruby-keyword kw">end</span>
|
303
|
+
</pre>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
</body>
|
312
|
+
</html>
|