Class Thin::Backends::Base
In: lib/thin/backends/base.rb
Parent: Object

A Backend connects the server to the client. It handles:

  • connection/disconnection to the server
  • initialization of the connections
  • manitoring of the active connections.

Implementing your own backend

You can create your own minimal backend by inheriting this class and defining the connect and disconnect method. If your backend is not based on EventMachine you also need to redefine the start, stop, stop! and config methods.

Methods

Attributes

maximum_connections  [RW]  Maximum number of file or socket descriptors that the server may open.
maximum_persistent_connections  [RW]  Maximum number of connections that can be persistent
persistent_connection_count  [RW]  Number of persistent connections currently opened
server  [RW]  Server serving the connections throught the backend
threaded  [W]  Allow using threads in the backend.
timeout  [RW]  Maximum time for incoming data to arrive

Public Class methods

Public Instance methods

Free up resources used by the backend.

Configure the backend. This method will be called before droping superuser privileges, so you can do crazy stuff that require godlike powers here.

Called by a connection when it‘s unbinded.

Returns true if no active connection.

Returns true if the backend is connected and running.

Number of active connections.

Start the backend and connect it.

Stop of the backend from accepting new connections.

Force stop of the backend NOW, too bad for the current connections.

Protected Instance methods

Initialize a new connection to a client.

[Validate]