Module: Iodine::Rack

Defined in:
lib/iodine/rack_utils.rb,
lib/rack/handler/iodine.rb,
ext/iodine_ext/iodine_helpers.c

Overview

Iodine's Rack module provides a Rack compliant interface (connecting Iodine to Rack) for an HTTP and Websocket Server.

Defined Under Namespace

Modules: Utils

Constant Summary collapse

IODINE_RACK_LOADED =
true

Class Method Summary collapse

Class Method Details

.run(app, options = {}) ⇒ Object

Runs a Rack app, as par the Rack handler requirements.



8
9
10
11
12
13
14
15
16
# File 'lib/rack/handler/iodine.rb', line 8

def self.run(app, options = {})
  # nested applications... is that a thing?
  Iodine.listen(service: :http, handler: app, port: options[:Port], address: options[:Host])

  # start Iodine
  Iodine.start

  true
end

.shutdownObject

patches an assumption by Rack, issue #98 code donated by @Shelvak (Néstor Coppi)



19
20
21
# File 'lib/rack/handler/iodine.rb', line 19

def self.shutdown
  Iodine.stop
end