grenache-ruby-http 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c0067db6a0553b48ee55b40bb10c38a066e65a8
4
- data.tar.gz: 6a168ab8efae135e0baecfd626d75447aa5fdab8
3
+ metadata.gz: 20fa647ee2208ea6dc289a3ae3bb15ec05eef710
4
+ data.tar.gz: 0c87d09f78ec8e5ecebe0fbc73bf2102c2cd378d
5
5
  SHA512:
6
- metadata.gz: 1230a0c4eb8241a557e337fc6d57fa2bb9ed10f324ca34bbcf7237f0a5cdb36435ffa29ebecbfed97f79f1ccd04ab6f06b5d980296641679d0dcb78df3fca8e8
7
- data.tar.gz: 2cc83302a824617126034a9bd747b6e2b2c1ab718816a6d4b350f75870f03fb17c9eb179814eb096348f65b4cbe2580b740a8acd450e358efa5e266b64949204
6
+ metadata.gz: c57c064c97cde2144b257c85d2777b07c532506262bb933805ab928f1bf040000bcd0d9bcd32ab4867c7d9eee43d54122a2f8fe78ecd141d69c0f6c5a303f975
7
+ data.tar.gz: ea181b7099a215dc36d52cf4d7b9b39dd4bc514e8ca2049cefc8baa0a01262320dc81341c739bfab41e5f79b1d62b51628349841dc0e28077a7c01559233a155
data/examples/worker.rb CHANGED
@@ -12,7 +12,7 @@ EM.run do
12
12
  c = Grenache::Http.new
13
13
 
14
14
  c.listen('rpc_test', 5004) do |msg|
15
- [nil,"hello #{msg.payload}"]
15
+ [StandardError.new("Error!"),"hello #{msg.payload}"]
16
16
  end
17
17
 
18
18
  end
data/lib/grenache/http.rb CHANGED
@@ -12,7 +12,8 @@ module Grenache
12
12
  EM.defer {
13
13
  app = -> (env) {
14
14
  req = ServiceMessage.parse(env['rack.input'].read)
15
- err, payload = block.call(req)
15
+ e, payload = block.call(req)
16
+ err = e.kind_of?(Exception) ? e.message : e
16
17
  [200,nil, ServiceMessage.new(payload, err, req.rid).to_json]
17
18
  }
18
19
  server = Thin::Server.start('0.0.0.0', port, app, {signals: false})
@@ -1,5 +1,5 @@
1
1
  module Grenache
2
2
  module HTTP
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grenache-ruby-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitfinex <info@bitfinex.com>