colouringcode-passenger 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +129 -0
- data/Rakefile +2 -2
- data/bin/passenger-install-apache2-module +1 -0
- data/bin/passenger-install-nginx-module +4 -2
- data/ext/apache2/Hooks.cpp +4 -2
- data/ext/common/ApplicationPoolServer.h +1 -1
- data/ext/common/ApplicationPoolServerExecutable.cpp +1 -1
- data/ext/common/MessageChannel.h +48 -4
- data/ext/common/StandardApplicationPool.h +4 -2
- data/ext/common/Version.h +1 -1
- data/ext/nginx/Configuration.c +1 -1
- data/ext/nginx/HttpStatusExtractor.h +1 -0
- data/ext/nginx/ScgiRequestParser.h +1 -0
- data/ext/oxt/system_calls.cpp +11 -0
- data/ext/oxt/system_calls.hpp +2 -1
- data/ext/oxt/thread.hpp +97 -1
- data/ext/phusion_passenger/native_support.c +30 -1
- data/lib/phusion_passenger/constants.rb +1 -1
- data/lib/phusion_passenger/dependencies.rb +32 -0
- data/lib/phusion_passenger/message_channel.rb +45 -3
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/rack/application_spawner.rb +10 -4
- data/lib/phusion_passenger/rack/request_handler.rb +2 -5
- data/lib/phusion_passenger/railz/application_spawner.rb +59 -7
- data/lib/phusion_passenger/utils.rb +70 -16
- data/{vendor/rack-1.0.0-git/lib/rack → lib/phusion_passenger/utils}/rewindable_input.rb +34 -9
- data/test/ApplicationPoolTest.cpp +1 -1
- data/test/MessageChannelTest.cpp +9 -1
- data/test/stub/message_channel.rb +1 -1
- data/test/stub/message_channel_2.rb +1 -1
- data/test/stub/message_channel_3.rb +2 -2
- metadata +43 -155
- data/doc/Architectural overview.html +0 -1
- data/doc/rdoc/classes/ConditionVariable.html +0 -194
- data/doc/rdoc/classes/Exception.html +0 -120
- data/doc/rdoc/classes/GC.html +0 -113
- data/doc/rdoc/classes/IO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger.html +0 -238
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -517
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -719
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -317
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
- data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -181
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -199
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -438
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -436
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -155
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -803
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PlatformInfo.html +0 -866
- data/doc/rdoc/classes/RakeExtensions.html +0 -197
- data/doc/rdoc/classes/Signal.html +0 -131
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -255
- data/doc/rdoc/files/README.html +0 -175
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -130
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -140
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -159
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -174
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
- data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
- data/doc/rdoc/fr_class_index.html +0 -91
- data/doc/rdoc/fr_file_index.html +0 -76
- data/doc/rdoc/fr_method_index.html +0 -205
- data/doc/rdoc/index.html +0 -26
- data/doc/rdoc/rdoc-style.css +0 -187
- data/vendor/README +0 -13
- data/vendor/README_FOR_PACKAGERS +0 -1
- data/vendor/rack-1.0.0-git/COPYING +0 -18
- data/vendor/rack-1.0.0-git/KNOWN-ISSUES +0 -18
- data/vendor/rack-1.0.0-git/README +0 -353
- data/vendor/rack-1.0.0-git/Rakefile +0 -164
- data/vendor/rack-1.0.0-git/lib/rack.rb +0 -90
- data/vendor/rack-1.0.0-git/lib/rack/adapter/camping.rb +0 -22
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/request.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/basic.rb +0 -58
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/md5.rb +0 -124
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/nonce.rb +0 -51
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/params.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/request.rb +0 -40
- data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +0 -487
- data/vendor/rack-1.0.0-git/lib/rack/builder.rb +0 -63
- data/vendor/rack-1.0.0-git/lib/rack/cascade.rb +0 -41
- data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +0 -49
- data/vendor/rack-1.0.0-git/lib/rack/commonlogger.rb +0 -52
- data/vendor/rack-1.0.0-git/lib/rack/conditionalget.rb +0 -47
- data/vendor/rack-1.0.0-git/lib/rack/content_length.rb +0 -29
- data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +0 -23
- data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +0 -96
- data/vendor/rack-1.0.0-git/lib/rack/directory.rb +0 -153
- data/vendor/rack-1.0.0-git/lib/rack/file.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler.rb +0 -69
- data/vendor/rack-1.0.0-git/lib/rack/handler/cgi.rb +0 -61
- data/vendor/rack-1.0.0-git/lib/rack/handler/evented_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/fastcgi.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler/lsws.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/handler/mongrel.rb +0 -84
- data/vendor/rack-1.0.0-git/lib/rack/handler/scgi.rb +0 -59
- data/vendor/rack-1.0.0-git/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/thin.rb +0 -18
- data/vendor/rack-1.0.0-git/lib/rack/handler/webrick.rb +0 -67
- data/vendor/rack-1.0.0-git/lib/rack/head.rb +0 -19
- data/vendor/rack-1.0.0-git/lib/rack/lint.rb +0 -537
- data/vendor/rack-1.0.0-git/lib/rack/lobster.rb +0 -65
- data/vendor/rack-1.0.0-git/lib/rack/lock.rb +0 -16
- data/vendor/rack-1.0.0-git/lib/rack/methodoverride.rb +0 -27
- data/vendor/rack-1.0.0-git/lib/rack/mime.rb +0 -204
- data/vendor/rack-1.0.0-git/lib/rack/mock.rb +0 -184
- data/vendor/rack-1.0.0-git/lib/rack/recursive.rb +0 -57
- data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/request.rb +0 -248
- data/vendor/rack-1.0.0-git/lib/rack/response.rb +0 -183
- data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +0 -142
- data/vendor/rack-1.0.0-git/lib/rack/session/cookie.rb +0 -91
- data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +0 -109
- data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +0 -100
- data/vendor/rack-1.0.0-git/lib/rack/showexceptions.rb +0 -349
- data/vendor/rack-1.0.0-git/lib/rack/showstatus.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/static.rb +0 -38
- data/vendor/rack-1.0.0-git/lib/rack/urlmap.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/utils.rb +0 -522
@@ -1,97 +0,0 @@
|
|
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::AbstractServer::ServerAlreadyStarted</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::AbstractServer::ServerAlreadyStarted</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/abstract_server_rb.html">lib/phusion_passenger/abstract_server.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
StandardError
|
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
|
-
Raised when a command is invoked that requires that the server is not
|
80
|
-
already started.
|
81
|
-
</p>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
</body>
|
97
|
-
</html>
|
@@ -1,96 +0,0 @@
|
|
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::AbstractServer::ServerError</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::AbstractServer::ServerError</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/abstract_server_rb.html">lib/phusion_passenger/abstract_server.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
StandardError
|
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
|
-
This exception means that the server process exited unexpectedly.
|
80
|
-
</p>
|
81
|
-
</div>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
</div>
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</body>
|
96
|
-
</html>
|
@@ -1,97 +0,0 @@
|
|
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::AbstractServer::ServerNotStarted</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::AbstractServer::ServerNotStarted</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/abstract_server_rb.html">lib/phusion_passenger/abstract_server.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
StandardError
|
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
|
-
Raised when a command is invoked that requires that the server is already
|
80
|
-
started.
|
81
|
-
</p>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
</body>
|
97
|
-
</html>
|
@@ -1,96 +0,0 @@
|
|
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::AbstractServer::UnknownMessage</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::AbstractServer::UnknownMessage</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/abstract_server_rb.html">lib/phusion_passenger/abstract_server.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
StandardError
|
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
|
-
Raised when the server receives a message with an unknown message name.
|
80
|
-
</p>
|
81
|
-
</div>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
</div>
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</body>
|
96
|
-
</html>
|
@@ -1,598 +0,0 @@
|
|
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::AbstractServerCollection</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::AbstractServerCollection</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/abstract_server_collection_rb.html">lib/phusion_passenger/abstract_server_collection.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
|
-
<div class="description"><p>
|
79
|
-
This class maintains a collection of <a
|
80
|
-
href="AbstractServer.html">AbstractServer</a> objects. One can add <a
|
81
|
-
href="AbstractServerCollection.html#M000104">new</a> <a
|
82
|
-
href="AbstractServer.html">AbstractServer</a> objects, or look up existing
|
83
|
-
ones via a key. <a
|
84
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a> also
|
85
|
-
automatically takes care of cleaning up AbstractServers that have been idle
|
86
|
-
for too long.
|
87
|
-
</p>
|
88
|
-
<p>
|
89
|
-
This class exists because both <a href="SpawnManager.html">SpawnManager</a>
|
90
|
-
and <a href="Railz/FrameworkSpawner.html">Railz::FrameworkSpawner</a> need
|
91
|
-
this kind of functionality. <a href="SpawnManager.html">SpawnManager</a>
|
92
|
-
maintains a collection of <a
|
93
|
-
href="Railz/FrameworkSpawner.html">Railz::FrameworkSpawner</a> and <a
|
94
|
-
href="Railz/ApplicationSpawner.html">Railz::ApplicationSpawner</a> objects,
|
95
|
-
while <a href="Railz/FrameworkSpawner.html">Railz::FrameworkSpawner</a>
|
96
|
-
maintains a collection of <a
|
97
|
-
href="Railz/ApplicationSpawner.html">Railz::ApplicationSpawner</a> objects.
|
98
|
-
</p>
|
99
|
-
<p>
|
100
|
-
This class is thread-safe as long as the specified thread-safety rules are
|
101
|
-
followed.
|
102
|
-
</p>
|
103
|
-
</div>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<div class="sectiontitle">Methods</div>
|
108
|
-
<ul>
|
109
|
-
<li><a href="#M000111">check_idle_servers!</a></li>
|
110
|
-
<li><a href="#M000115">cleanup</a></li>
|
111
|
-
<li><a href="#M000114">clear</a></li>
|
112
|
-
<li><a href="#M000109">delete</a></li>
|
113
|
-
<li><a href="#M000112">each</a></li>
|
114
|
-
<li><a href="#M000113">each_pair</a></li>
|
115
|
-
<li><a href="#M000108">empty?</a></li>
|
116
|
-
<li><a href="#M000107">has_key?</a></li>
|
117
|
-
<li><a href="#M000106">lookup_or_add</a></li>
|
118
|
-
<li><a href="#M000104">new</a></li>
|
119
|
-
<li><a href="#M000110">register_activity</a></li>
|
120
|
-
<li><a href="#M000105">synchronize</a></li>
|
121
|
-
</ul>
|
122
|
-
|
123
|
-
<div class="sectiontitle">Included Modules</div>
|
124
|
-
<ul>
|
125
|
-
<li><a href="Utils.html">Utils</a></li>
|
126
|
-
</ul>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<div class="sectiontitle">Attributes</div>
|
132
|
-
<table border='0' cellpadding='5'>
|
133
|
-
<tr valign='top'>
|
134
|
-
<td class='attr-rw'>
|
135
|
-
[R]
|
136
|
-
</td>
|
137
|
-
<td class='attr-name'>next_cleaning_time</td>
|
138
|
-
<td class='attr-desc'></td>
|
139
|
-
</tr>
|
140
|
-
</table>
|
141
|
-
|
142
|
-
<div class="sectiontitle">Public Class methods</div>
|
143
|
-
<div class="method">
|
144
|
-
<div class="title">
|
145
|
-
<a name="M000104"></a><b>new</b>()
|
146
|
-
</div>
|
147
|
-
<div class="sourcecode">
|
148
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000104_source')" id="l_M000104_source">show source</a> ]</p>
|
149
|
-
<div id="M000104_source" class="dyn-source">
|
150
|
-
<pre>
|
151
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 44</span>
|
152
|
-
44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
153
|
-
45: <span class="ruby-ivar">@collection</span> = {}
|
154
|
-
46: <span class="ruby-ivar">@lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
155
|
-
47: <span class="ruby-ivar">@cleanup_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
156
|
-
48: <span class="ruby-ivar">@cond</span> = <span class="ruby-constant">ConditionVariable</span>.<span class="ruby-identifier">new</span>
|
157
|
-
49: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">false</span>
|
158
|
-
50:
|
159
|
-
51: <span class="ruby-comment cmt"># The next time the cleaner thread should check for idle servers.</span>
|
160
|
-
52: <span class="ruby-comment cmt"># The value may be nil, in which case the value will be calculated</span>
|
161
|
-
53: <span class="ruby-comment cmt"># at the end of the #synchronized block.</span>
|
162
|
-
54: <span class="ruby-comment cmt">#</span>
|
163
|
-
55: <span class="ruby-comment cmt"># Invariant:</span>
|
164
|
-
56: <span class="ruby-comment cmt"># if value is not nil:</span>
|
165
|
-
57: <span class="ruby-comment cmt"># There exists an s in @collection with s.next_cleaning_time == value.</span>
|
166
|
-
58: <span class="ruby-comment cmt"># for all s in @collection:</span>
|
167
|
-
59: <span class="ruby-comment cmt"># if eligable_for_cleanup?(s):</span>
|
168
|
-
60: <span class="ruby-comment cmt"># s.next_cleaning_time <= value</span>
|
169
|
-
61: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
170
|
-
62: <span class="ruby-ivar">@next_cleaning_time_changed</span> = <span class="ruby-keyword kw">false</span>
|
171
|
-
63:
|
172
|
-
64: <span class="ruby-ivar">@cleaner_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
173
|
-
65: <span class="ruby-keyword kw">begin</span>
|
174
|
-
66: <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
175
|
-
67: <span class="ruby-identifier">cleaner_thread_main</span>
|
176
|
-
68: <span class="ruby-keyword kw">end</span>
|
177
|
-
69: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
178
|
-
70: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
|
179
|
-
71: <span class="ruby-keyword kw">end</span>
|
180
|
-
72: <span class="ruby-keyword kw">end</span>
|
181
|
-
73: <span class="ruby-keyword kw">end</span>
|
182
|
-
</pre>
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
<div class="sectiontitle">Public Instance methods</div>
|
187
|
-
<div class="method">
|
188
|
-
<div class="title">
|
189
|
-
<a name="M000111"></a><b>check_idle_servers!</b>()
|
190
|
-
</div>
|
191
|
-
<div class="description">
|
192
|
-
<p>
|
193
|
-
Tell the cleaner thread to check the collection as soon as possible,
|
194
|
-
instead of sleeping until the next scheduled cleaning time.
|
195
|
-
</p>
|
196
|
-
<p>
|
197
|
-
Precondition: this method must NOT be called within a <a
|
198
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
199
|
-
</p>
|
200
|
-
</div>
|
201
|
-
<div class="sourcecode">
|
202
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000111_source')" id="l_M000111_source">show source</a> ]</p>
|
203
|
-
<div id="M000111_source" class="dyn-source">
|
204
|
-
<pre>
|
205
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 198</span>
|
206
|
-
198: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_idle_servers!</span>
|
207
|
-
199: <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
208
|
-
200: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
209
|
-
201: <span class="ruby-ivar">@cond</span>.<span class="ruby-identifier">signal</span>
|
210
|
-
202: <span class="ruby-keyword kw">end</span>
|
211
|
-
203: <span class="ruby-keyword kw">end</span>
|
212
|
-
</pre>
|
213
|
-
</div>
|
214
|
-
</div>
|
215
|
-
</div>
|
216
|
-
<div class="method">
|
217
|
-
<div class="title">
|
218
|
-
<a name="M000115"></a><b>cleanup</b>()
|
219
|
-
</div>
|
220
|
-
<div class="description">
|
221
|
-
<p>
|
222
|
-
Cleanup all resources used by this <a
|
223
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a>. All
|
224
|
-
AbstractServers from the collection will be deleted. Each <a
|
225
|
-
href="AbstractServer.html">AbstractServer</a> will be stopped, if
|
226
|
-
necessary. The background thread which removes idle AbstractServers will be
|
227
|
-
stopped.
|
228
|
-
</p>
|
229
|
-
<p>
|
230
|
-
After calling this method, this <a
|
231
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a> object
|
232
|
-
will become unusable.
|
233
|
-
</p>
|
234
|
-
<p>
|
235
|
-
Precondition: this method must <b>NOT</b> be called within a <a
|
236
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
237
|
-
</p>
|
238
|
-
</div>
|
239
|
-
<div class="sourcecode">
|
240
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000115_source')" id="l_M000115_source">show source</a> ]</p>
|
241
|
-
<div id="M000115_source" class="dyn-source">
|
242
|
-
<pre>
|
243
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 246</span>
|
244
|
-
246: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
|
245
|
-
247: <span class="ruby-ivar">@cleanup_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
246
|
-
248: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@done</span>
|
247
|
-
249: <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
248
|
-
250: <span class="ruby-ivar">@done</span> = <span class="ruby-keyword kw">true</span>
|
249
|
-
251: <span class="ruby-ivar">@cond</span>.<span class="ruby-identifier">signal</span>
|
250
|
-
252: <span class="ruby-keyword kw">end</span>
|
251
|
-
253: <span class="ruby-ivar">@cleaner_thread</span>.<span class="ruby-identifier">join</span>
|
252
|
-
254: <span class="ruby-identifier">clear</span>
|
253
|
-
255: <span class="ruby-keyword kw">end</span>
|
254
|
-
256: <span class="ruby-keyword kw">end</span>
|
255
|
-
</pre>
|
256
|
-
</div>
|
257
|
-
</div>
|
258
|
-
</div>
|
259
|
-
<div class="method">
|
260
|
-
<div class="title">
|
261
|
-
<a name="M000114"></a><b>clear</b>()
|
262
|
-
</div>
|
263
|
-
<div class="description">
|
264
|
-
<p>
|
265
|
-
Delete all AbstractServers from the collection. Each <a
|
266
|
-
href="AbstractServer.html">AbstractServer</a> will be stopped, if
|
267
|
-
necessary.
|
268
|
-
</p>
|
269
|
-
<p>
|
270
|
-
Precondition: this method must be called within a <a
|
271
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
272
|
-
</p>
|
273
|
-
</div>
|
274
|
-
<div class="sourcecode">
|
275
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000114_source')" id="l_M000114_source">show source</a> ]</p>
|
276
|
-
<div id="M000114_source" class="dyn-source">
|
277
|
-
<pre>
|
278
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 228</span>
|
279
|
-
228: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear</span>
|
280
|
-
229: <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
281
|
-
230: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">started?</span>
|
282
|
-
231: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">stop</span>
|
283
|
-
232: <span class="ruby-keyword kw">end</span>
|
284
|
-
233: <span class="ruby-keyword kw">end</span>
|
285
|
-
234: <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">clear</span>
|
286
|
-
235: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-keyword kw">nil</span>
|
287
|
-
236: <span class="ruby-keyword kw">end</span>
|
288
|
-
</pre>
|
289
|
-
</div>
|
290
|
-
</div>
|
291
|
-
</div>
|
292
|
-
<div class="method">
|
293
|
-
<div class="title">
|
294
|
-
<a name="M000109"></a><b>delete</b>(key)
|
295
|
-
</div>
|
296
|
-
<div class="description">
|
297
|
-
<p>
|
298
|
-
Deletes from the collection the <a
|
299
|
-
href="AbstractServer.html">AbstractServer</a> that‘s associated with
|
300
|
-
the given key. If no such <a href="AbstractServer.html">AbstractServer</a>
|
301
|
-
exists, nothing will happen.
|
302
|
-
</p>
|
303
|
-
<p>
|
304
|
-
If the <a href="AbstractServer.html">AbstractServer</a> is started, then it
|
305
|
-
will be stopped before deletion.
|
306
|
-
</p>
|
307
|
-
<p>
|
308
|
-
Precondition: this method must be called within a <a
|
309
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
310
|
-
</p>
|
311
|
-
</div>
|
312
|
-
<div class="sourcecode">
|
313
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000109_source')" id="l_M000109_source">show source</a> ]</p>
|
314
|
-
<div id="M000109_source" class="dyn-source">
|
315
|
-
<pre>
|
316
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 162</span>
|
317
|
-
162: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
318
|
-
163: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"cleanup() has already been called."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@done</span>
|
319
|
-
164: <span class="ruby-identifier">server</span> = <span class="ruby-ivar">@collection</span>[<span class="ruby-identifier">key</span>]
|
320
|
-
165: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>
|
321
|
-
166: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">started?</span>
|
322
|
-
167: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">stop</span>
|
323
|
-
168: <span class="ruby-keyword kw">end</span>
|
324
|
-
169: <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
|
325
|
-
170: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@next_cleaning_time</span>
|
326
|
-
171: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-keyword kw">nil</span>
|
327
|
-
172: <span class="ruby-keyword kw">end</span>
|
328
|
-
173: <span class="ruby-keyword kw">end</span>
|
329
|
-
174: <span class="ruby-keyword kw">end</span>
|
330
|
-
</pre>
|
331
|
-
</div>
|
332
|
-
</div>
|
333
|
-
</div>
|
334
|
-
<div class="method">
|
335
|
-
<div class="title">
|
336
|
-
<a name="M000112"></a><b>each</b>() {|server| ...}
|
337
|
-
</div>
|
338
|
-
<div class="description">
|
339
|
-
<p>
|
340
|
-
Iterate over all <a href="AbstractServer.html">AbstractServer</a> objects.
|
341
|
-
</p>
|
342
|
-
<p>
|
343
|
-
Precondition: this method must be called within a <a
|
344
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
345
|
-
</p>
|
346
|
-
</div>
|
347
|
-
<div class="sourcecode">
|
348
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000112_source')" id="l_M000112_source">show source</a> ]</p>
|
349
|
-
<div id="M000112_source" class="dyn-source">
|
350
|
-
<pre>
|
351
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 208</span>
|
352
|
-
208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
353
|
-
209: <span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
354
|
-
210: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">server</span>
|
355
|
-
211: <span class="ruby-keyword kw">end</span>
|
356
|
-
212: <span class="ruby-keyword kw">end</span>
|
357
|
-
</pre>
|
358
|
-
</div>
|
359
|
-
</div>
|
360
|
-
</div>
|
361
|
-
<div class="method">
|
362
|
-
<div class="title">
|
363
|
-
<a name="M000113"></a><b>each_pair</b>() {|key, server| ...}
|
364
|
-
</div>
|
365
|
-
<div class="description">
|
366
|
-
<p>
|
367
|
-
Iterate over all keys and associated <a
|
368
|
-
href="AbstractServer.html">AbstractServer</a> objects.
|
369
|
-
</p>
|
370
|
-
<p>
|
371
|
-
Precondition: this method must be called within a <a
|
372
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
373
|
-
</p>
|
374
|
-
</div>
|
375
|
-
<div class="sourcecode">
|
376
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000113_source')" id="l_M000113_source">show source</a> ]</p>
|
377
|
-
<div id="M000113_source" class="dyn-source">
|
378
|
-
<pre>
|
379
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 217</span>
|
380
|
-
217: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_pair</span>
|
381
|
-
218: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"cleanup() has already been called."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@done</span>
|
382
|
-
219: <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
383
|
-
220: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">server</span>)
|
384
|
-
221: <span class="ruby-keyword kw">end</span>
|
385
|
-
222: <span class="ruby-keyword kw">end</span>
|
386
|
-
</pre>
|
387
|
-
</div>
|
388
|
-
</div>
|
389
|
-
</div>
|
390
|
-
<div class="method">
|
391
|
-
<div class="title">
|
392
|
-
<a name="M000108"></a><b>empty?</b>()
|
393
|
-
</div>
|
394
|
-
<div class="description">
|
395
|
-
<p>
|
396
|
-
Checks whether the collection is empty.
|
397
|
-
</p>
|
398
|
-
<p>
|
399
|
-
Precondition: this method must be called within a <a
|
400
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
401
|
-
</p>
|
402
|
-
</div>
|
403
|
-
<div class="sourcecode">
|
404
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000108_source')" id="l_M000108_source">show source</a> ]</p>
|
405
|
-
<div id="M000108_source" class="dyn-source">
|
406
|
-
<pre>
|
407
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 152</span>
|
408
|
-
152: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">empty?</span>
|
409
|
-
153: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">empty?</span>
|
410
|
-
154: <span class="ruby-keyword kw">end</span>
|
411
|
-
</pre>
|
412
|
-
</div>
|
413
|
-
</div>
|
414
|
-
</div>
|
415
|
-
<div class="method">
|
416
|
-
<div class="title">
|
417
|
-
<a name="M000107"></a><b>has_key?</b>(key)
|
418
|
-
</div>
|
419
|
-
<div class="description">
|
420
|
-
<p>
|
421
|
-
Checks whether there‘s an <a
|
422
|
-
href="AbstractServer.html">AbstractServer</a> object associated with the
|
423
|
-
given key.
|
424
|
-
</p>
|
425
|
-
<p>
|
426
|
-
Precondition: this method must be called within a <a
|
427
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
428
|
-
</p>
|
429
|
-
</div>
|
430
|
-
<div class="sourcecode">
|
431
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000107_source')" id="l_M000107_source">show source</a> ]</p>
|
432
|
-
<div id="M000107_source" class="dyn-source">
|
433
|
-
<pre>
|
434
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 145</span>
|
435
|
-
145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
|
436
|
-
146: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
|
437
|
-
147: <span class="ruby-keyword kw">end</span>
|
438
|
-
</pre>
|
439
|
-
</div>
|
440
|
-
</div>
|
441
|
-
</div>
|
442
|
-
<div class="method">
|
443
|
-
<div class="title">
|
444
|
-
<a name="M000106"></a><b>lookup_or_add</b>(key) {|| ...}
|
445
|
-
</div>
|
446
|
-
<div class="description">
|
447
|
-
<p>
|
448
|
-
Lookup and returns an <a href="AbstractServer.html">AbstractServer</a> with
|
449
|
-
the given key.
|
450
|
-
</p>
|
451
|
-
<p>
|
452
|
-
If there is no AbstractSerer associated with the given key, then the given
|
453
|
-
block will be called. That block must return an <a
|
454
|
-
href="AbstractServer.html">AbstractServer</a> object. Then, that object
|
455
|
-
will be stored in the collection, and returned.
|
456
|
-
</p>
|
457
|
-
<p>
|
458
|
-
The block must set the ‘max_idle_time’ attribute on the <a
|
459
|
-
href="AbstractServer.html">AbstractServer</a>. <a
|
460
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a>‘s
|
461
|
-
idle cleaning interval will be adapted to accomodate with this. Changing
|
462
|
-
the value outside this block is not guaranteed to have any effect on the
|
463
|
-
idle cleaning interval. A max_idle_time value of nil or 0 means the <a
|
464
|
-
href="AbstractServer.html">AbstractServer</a> will never be idle cleaned.
|
465
|
-
</p>
|
466
|
-
<p>
|
467
|
-
If the block raises an exception, then the collection will not be modified,
|
468
|
-
and the exception will be propagated.
|
469
|
-
</p>
|
470
|
-
<p>
|
471
|
-
Precondition: this method must be called within a <a
|
472
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
473
|
-
</p>
|
474
|
-
</div>
|
475
|
-
<div class="sourcecode">
|
476
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000106_source')" id="l_M000106_source">show source</a> ]</p>
|
477
|
-
<div id="M000106_source" class="dyn-source">
|
478
|
-
<pre>
|
479
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 119</span>
|
480
|
-
119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup_or_add</span>(<span class="ruby-identifier">key</span>)
|
481
|
-
120: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"cleanup() has already been called."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@done</span>
|
482
|
-
121: <span class="ruby-identifier">server</span> = <span class="ruby-ivar">@collection</span>[<span class="ruby-identifier">key</span>]
|
483
|
-
122: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>
|
484
|
-
123: <span class="ruby-identifier">register_activity</span>(<span class="ruby-identifier">server</span>)
|
485
|
-
124: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">server</span>
|
486
|
-
125: <span class="ruby-keyword kw">else</span>
|
487
|
-
126: <span class="ruby-identifier">server</span> = <span class="ruby-keyword kw">yield</span>
|
488
|
-
127: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">server</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:start</span>)
|
489
|
-
128: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">"The block didn't return a valid AbstractServer object."</span>
|
490
|
-
129: <span class="ruby-keyword kw">end</span>
|
491
|
-
130: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">eligable_for_cleanup?</span>(<span class="ruby-identifier">server</span>)
|
492
|
-
131: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">max_idle_time</span>
|
493
|
-
132: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@next_cleaning_time</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@next_cleaning_time</span>
|
494
|
-
133: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span>
|
495
|
-
134: <span class="ruby-ivar">@next_cleaning_time_changed</span> = <span class="ruby-keyword kw">true</span>
|
496
|
-
135: <span class="ruby-keyword kw">end</span>
|
497
|
-
136: <span class="ruby-keyword kw">end</span>
|
498
|
-
137: <span class="ruby-ivar">@collection</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">server</span>
|
499
|
-
138: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">server</span>
|
500
|
-
139: <span class="ruby-keyword kw">end</span>
|
501
|
-
140: <span class="ruby-keyword kw">end</span>
|
502
|
-
</pre>
|
503
|
-
</div>
|
504
|
-
</div>
|
505
|
-
</div>
|
506
|
-
<div class="method">
|
507
|
-
<div class="title">
|
508
|
-
<a name="M000110"></a><b>register_activity</b>(server)
|
509
|
-
</div>
|
510
|
-
<div class="description">
|
511
|
-
<p>
|
512
|
-
Notify this <a
|
513
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a> that
|
514
|
-
<tt>server</tt> has performed an activity. This <a
|
515
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a> will
|
516
|
-
update the idle information associated with <tt>server</tt> accordingly.
|
517
|
-
</p>
|
518
|
-
<p>
|
519
|
-
<a href="AbstractServerCollection.html#M000106">lookup_or_add</a> already
|
520
|
-
automatically updates idle information, so you only need to call this
|
521
|
-
method if the time at which the server has performed an activity is not
|
522
|
-
close to the time at which <a
|
523
|
-
href="AbstractServerCollection.html#M000106">lookup_or_add</a> had been
|
524
|
-
called.
|
525
|
-
</p>
|
526
|
-
<p>
|
527
|
-
Precondition: this method must be called within a <a
|
528
|
-
href="AbstractServerCollection.html#M000105">#synchronize</a> block.
|
529
|
-
</p>
|
530
|
-
</div>
|
531
|
-
<div class="sourcecode">
|
532
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000110_source')" id="l_M000110_source">show source</a> ]</p>
|
533
|
-
<div id="M000110_source" class="dyn-source">
|
534
|
-
<pre>
|
535
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 185</span>
|
536
|
-
185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register_activity</span>(<span class="ruby-identifier">server</span>)
|
537
|
-
186: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">eligable_for_cleanup?</span>(<span class="ruby-identifier">server</span>)
|
538
|
-
187: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@next_cleaning_time</span>
|
539
|
-
188: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-keyword kw">nil</span>
|
540
|
-
189: <span class="ruby-keyword kw">end</span>
|
541
|
-
190: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">max_idle_time</span>
|
542
|
-
191: <span class="ruby-keyword kw">end</span>
|
543
|
-
192: <span class="ruby-keyword kw">end</span>
|
544
|
-
</pre>
|
545
|
-
</div>
|
546
|
-
</div>
|
547
|
-
</div>
|
548
|
-
<div class="method">
|
549
|
-
<div class="title">
|
550
|
-
<a name="M000105"></a><b>synchronize</b>() {|| ...}
|
551
|
-
</div>
|
552
|
-
<div class="description">
|
553
|
-
<p>
|
554
|
-
Acquire the lock for this <a
|
555
|
-
href="AbstractServerCollection.html">AbstractServerCollection</a> object,
|
556
|
-
and run the code within the block. The entire block will be a single atomic
|
557
|
-
operation.
|
558
|
-
</p>
|
559
|
-
</div>
|
560
|
-
<div class="sourcecode">
|
561
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000105_source')" id="l_M000105_source">show source</a> ]</p>
|
562
|
-
<div id="M000105_source" class="dyn-source">
|
563
|
-
<pre>
|
564
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_server_collection.rb, line 78</span>
|
565
|
-
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">synchronize</span>
|
566
|
-
79: <span class="ruby-ivar">@lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
567
|
-
80: <span class="ruby-keyword kw">yield</span>
|
568
|
-
81: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@next_cleaning_time</span>.<span class="ruby-identifier">nil?</span>
|
569
|
-
82: <span class="ruby-ivar">@collection</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>
|
570
|
-
83: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@next_cleaning_time</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span>
|
571
|
-
84: (<span class="ruby-identifier">eligable_for_cleanup?</span>(<span class="ruby-identifier">server</span>) <span class="ruby-operator">&&</span>
|
572
|
-
85: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@next_cleaning_time</span>
|
573
|
-
86: )
|
574
|
-
87: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">next_cleaning_time</span>
|
575
|
-
88: <span class="ruby-keyword kw">end</span>
|
576
|
-
89: <span class="ruby-keyword kw">end</span>
|
577
|
-
90: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@next_cleaning_time</span>.<span class="ruby-identifier">nil?</span>
|
578
|
-
91: <span class="ruby-comment cmt"># There are no servers in the collection with an idle timeout.</span>
|
579
|
-
92: <span class="ruby-ivar">@next_cleaning_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">+</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
580
|
-
93: <span class="ruby-keyword kw">end</span>
|
581
|
-
94: <span class="ruby-ivar">@next_cleaning_time_changed</span> = <span class="ruby-keyword kw">true</span>
|
582
|
-
95: <span class="ruby-keyword kw">end</span>
|
583
|
-
96: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@next_cleaning_time_changed</span>
|
584
|
-
97: <span class="ruby-ivar">@next_cleaning_time_changed</span> = <span class="ruby-keyword kw">false</span>
|
585
|
-
98: <span class="ruby-ivar">@cond</span>.<span class="ruby-identifier">signal</span>
|
586
|
-
99: <span class="ruby-keyword kw">end</span>
|
587
|
-
100: <span class="ruby-keyword kw">end</span>
|
588
|
-
101: <span class="ruby-keyword kw">end</span>
|
589
|
-
</pre>
|
590
|
-
</div>
|
591
|
-
</div>
|
592
|
-
</div>
|
593
|
-
</div>
|
594
|
-
|
595
|
-
</div>
|
596
|
-
|
597
|
-
</body>
|
598
|
-
</html>
|