Module: M2R

Defined in:
lib/m2r.rb,
lib/m2r/reply.rb,
lib/m2r/handler.rb,
lib/m2r/headers.rb,
lib/m2r/request.rb,
lib/m2r/version.rb,
lib/m2r/response.rb,
lib/m2r/connection.rb,
lib/m2r/http/close.rb,
lib/m2r/rack_handler.rb,
lib/m2r/request/base.rb,
lib/m2r/request/upload.rb,
lib/m2r/connection_factory.rb,
lib/m2r/response/to_request.rb,
lib/m2r/response/always_close.rb,
lib/m2r/response/content_length.rb

Overview

Allows you to easily interact with Mongrel2 webserver from your ruby code.

Defined Under Namespace

Modules: Base, HTTP, Upload Classes: Connection, ConnectionFactory, Handler, Headers, RackHandler, Reply, Request, Response

Constant Summary collapse

VERSION =

m2r gem version

'2.0.1'

Class Attribute Summary collapse

Class Attribute Details

.zmq_context(zmq_io_threads = 1) ⇒ ZMQ::Context

Note:

This method is thread-safe but it uses Thread.exclusive to achive that. However it is unlikely that it affects the performance as you probably do not create more than a dozen of sockets in your code.

Gets (or sets if not existing) ZMQ context used by M2R to create sockets.

Parameters:

  • zmq_io_threads (Fixnum) (defaults to: 1)

    Size of the ZMQ thread pool to handle I/O operations. The rule of thumb is to make it equal to the number gigabits per second that the application will produce.

Returns:

  • (ZMQ::Context)

See Also:

  • #zmq_context=


33
34
35
36
37
# File 'lib/m2r.rb', line 33

def zmq_context(zmq_io_threads = 1)
  Thread.exclusive do
    @zmq_context ||= ZMQ::Context.new(zmq_io_threads)
  end
end