module M2R
Allows you to easily interact with Mongrel2
webserver from your ruby code. @api public
Constants
- VERSION
m2r gem version @api public
Attributes
Public Class Methods
zmq_context(zmq_io_threads = 1)
click to toggle source
Gets (or sets if not existing) ZMQ context used by M2R
to create sockets.
@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.
@param [Fixnum] zmq_io_threads 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.
@return [ZMQ::Context] @see zmq_context= @api public
# 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