Class: Merb::Rack::AbstractAdapter

Class | Merb::Rack::AbstractAdapter
In: | lib/merb-core/rack/adapter/abstract.rb
Parent: | Object

### Methods

exit_process new_server process_title spawn_worker start start_at_port start_server stop

### Public Class methods

exit_process(status = 0)

Exit the process with the specified status.

#### Parameters

status<Integer>: | The exit code of the process.

:api: private

new_server(port)

This method is designed to be overridden in a rack adapter. It will be called to create a new instance of the server for the adapter to start. The adapter should attempt to bind to a port at this point. This is called from the AbstractAdapter start method.

#### Parameters

port<Integer>: | The port the server should listen on

:api: plugin @overridable

process_title(whoami, port)

Set the process title.

#### Parameters

whoami<Symbol>: | Either :spawner for the master process or :worker for any of the worker

      processes.

port<Integer>: | The base port that the app is running on.

:api: private

spawn_worker(port)

Spawn a new worker process at a port.

#### Parameters

port<Integer>: | The port to start the worker process on.

:api: private

start(opts={})

The main start method for bootloaders that support forking. This method launches the adapters which inherit using the new_server and start_server methods. This method should not be overridden in adapters which want to fork.

#### Parameters

opts<Hash>: | A hash of options

      socket: the socket to bind to
      port: the port to bind to
      cluster: the number

:api: private

start_at_port(port, opts = @opts)

Fork a server on the specified port and start the app.

#### Parameters

port<Integer>: | The port to start the server on
opts<Hash>: | The hash of options, defaults to the @opts

      instance variable.

:api: private

start_server()

This method is designed to be overridden in a rack adapter. It will be called to start a server created with the new_server method. This is called from the AbstractAdapter start method.

:api: plugin @overridable

stop(status)

This method is designed to be overridden in a rack adapter. It will be called to stop the adapter server.

#### Parameters

status<Integer>: | The exit status the adapter should exit with.

#### Returns

Boolean: | True if the server was properly stopped.

:api: plugin @overridable

[Validate]