0
@@ -13,6 +13,11 @@ module Passenger
0
# Internally, SpawnManager uses FrameworkSpawner to preload and cache
0
# Ruby on Rails frameworks. FrameworkSpawner, in turn, uses
0
# ApplicationSpawner to preload and cache application code.
0
+# *Note*: SpawnManager may only be started synchronously with
0
+# AbstractServer#start_synchronously. Starting asynchronously has not been
0
+# tested. Don't forget to call cleanup after the server's main loop has
0
class SpawnManager < AbstractServer
0
SPAWNER_CLEAN_INTERVAL = 30 * 60
0
@@ -33,6 +38,27 @@ class SpawnManager < AbstractServer
0
define_signal_handler('SIGHUP', :reload)
0
+ # Spawn a RoR application When successful, an Application object will be
0
+ # returned, which represents the spawned RoR application.
0
+ # See ApplicationSpawner.new for an explanation of the +lower_privilege+
0
+ # and +lowest_user+ parameters.
0
+ # SpawnManager will internally cache the code of applications, in order to
0
+ # speed up future spawning attempts. This implies that, if you've
0
+ # changed the application's code, you must do one of these things:
0
+ # - Restart this SpawnManager by calling AbstractServer#stop, then AbstractServer#start.
0
+ # - Reload the application by calling reload with the correct app_root argument.
0
+ # - ArgumentError: +app_root+ doesn't appear to be a valid Ruby on Rails application root.
0
+ # - VersionNotFound: The Ruby on Rails framework version that the given application requires
0
+ # - InitializationError: Either the Ruby on Rails framework version that the given application
0
+ # requires could not be loaded, or the application raised an exception or called exit()
0
+ # - IOError: The ApplicationSpawner server exited unexpectedly.
0
+ # - SpawnError: The FrameworkSpawner server exited unexpectedly.
0
def spawn_application(app_root, lower_privilege = true, lowest_user = "nobody")
0
framework_version = Application.detect_framework_version(app_root)
0
@@ -60,7 +86,7 @@ class SpawnManager < AbstractServer
0
# If nil is specified as application root, then all cached application
0
# instances will be removed, no matter the application root.
0
+ #
<b>Long description:</b>0
# Application code might be cached in memory. But once it a while, it will
0
# be necessary to reload the code for an application, such as after
0
# deploying a new version of the application. This method makes sure that
0
@@ -77,6 +103,8 @@ class SpawnManager < AbstractServer
0
+ # Cleanup resources. Should be called after AbstractServer#start_synchronously
Comments
No one has commented yet.