Class | PhusionPassenger::SpawnManager |
In: |
lib/phusion_passenger/spawn_manager.rb
|
Parent: | AbstractServer |
The spawn manager is capable of spawning Ruby on Rails or Rack application instances. It acts like a simple fascade for the rest of the spawn manager system.
Note: SpawnManager may only be started synchronously with AbstractServer#start_synchronously. Starting asynchronously has not been tested. Don‘t forget to call cleanup after the server‘s main loop has finished.
Spawning a Ruby on Rails application is usually slow. But SpawnManager will preload and cache Ruby on Rails frameworks, as well as application code, so subsequent spawns will be very fast.
Internally, SpawnManager uses ClassicRails::FrameworkSpawner to preload and cache Ruby on Rails frameworks. ClassicRails::FrameworkSpawner, in turn, uses ClassicRails::ApplicationSpawner to preload and cache application code.
In case you‘re wondering why the namespace is "ClassicRails" and not "Rails": it‘s to work around an obscure bug in ActiveSupport‘s Dispatcher.
Remove the cached application instances at the given group name. If nil is specified as group name, then all cached application instances will be removed, no matter the group name.
Long description: Application code might be cached in memory. But once it a while, it will be necessary to reload the code for an application, such as after deploying a new version of the application. This method makes sure that any cached application code is removed, so that the next time an application instance is spawned, the application code will be freshly loaded into memory.
Raises AbstractServer::SpawnError if something went wrong.
Spawns an application with the given spawn options. When successful, an AppProcess object will be returned, which represents the spawned application process.
Most options are explained in PoolOptions.h.
Mandatory options:
Optional options:
Exceptions: