Class: Isono::Rack::DataStore

Inherits:
Decorator show all
Defined in:
lib/isono/rack/data_store.rb

Overview

Runs app.call() in the thread context of DataStore’s worker.

Instance Attribute Summary

Attributes inherited from Decorator

#app

Instance Method Summary collapse

Methods inherited from Decorator

#initialize

Constructor Details

This class inherits a constructor from Isono::Rack::Decorator

Instance Method Details

#call(req, res) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/isono/rack/data_store.rb', line 7

def call(req, res)
  NodeModules::DataStore.pass {
    begin
      ret = @app.call(req, res)
      res.response(ret) unless res.responded?
    rescue ::Exception => e
      res.response(e) unless res.responded?
      raise e
    end
  }
end