superbolt 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/superbolt/app.rb +5 -4
- data/lib/superbolt/connection/app.rb +3 -2
- data/lib/superbolt/version.rb +1 -1
- data/spec/app_spec.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34069be8f4689aa269cf82304fed8ca450cf30c6
|
4
|
+
data.tar.gz: 5310a1c39534aae35cc76624cbb1d200cd9cbfa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5acdf639a27305f47f0b8db5852c50fb482daa3a7c2d8ebedb63188df96ebb66999faaa75e156b9e33f890133cd298410c99b1f09c6e0ef524a2c8956384c827
|
7
|
+
data.tar.gz: 01629e7f989530e35060193436fb72d2c7bed8520553a19da5a1baf1bfba9e7ea0cba8f8821d40dc7ff6949921415cb3398424dd1cdf15c2a5b8305ccaa2face
|
data/.gitignore
CHANGED
data/lib/superbolt/app.rb
CHANGED
@@ -40,7 +40,7 @@ module Superbolt
|
|
40
40
|
|
41
41
|
def run(&block)
|
42
42
|
EventMachine.run do
|
43
|
-
queue.subscribe(ack: false) do |metadata, payload|
|
43
|
+
queue.subscribe(ack: false) do |metadata, properties, payload|
|
44
44
|
message = IncomingMessage.new(metadata, payload, channel)
|
45
45
|
processor = Processor.new(message, logger, &block)
|
46
46
|
unless processor.perform
|
@@ -48,8 +48,9 @@ module Superbolt
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
quit_subscriber_queue.subscribe do |
|
52
|
-
|
51
|
+
quit_subscriber_queue.subscribe do |metadata, properties, payload|
|
52
|
+
parsed_payload = JSON.parse(payload)
|
53
|
+
quit(parsed_payload['message'])
|
53
54
|
end
|
54
55
|
end
|
55
56
|
end
|
@@ -66,7 +67,7 @@ module Superbolt
|
|
66
67
|
def quit(message='no message given')
|
67
68
|
logger.info "EXITING Superbolt App listening on queue #{name}: #{message}"
|
68
69
|
close {
|
69
|
-
EventMachine.stop
|
70
|
+
EventMachine.stop
|
70
71
|
}
|
71
72
|
end
|
72
73
|
end
|
@@ -2,14 +2,15 @@ module Superbolt
|
|
2
2
|
module Connection
|
3
3
|
class App < Base
|
4
4
|
def connection
|
5
|
-
@connection ||= Adapter::
|
5
|
+
@connection ||= Adapter::Bunny.new(config)
|
6
6
|
end
|
7
7
|
|
8
8
|
def close(&block)
|
9
|
-
connection.close
|
9
|
+
connection.close
|
10
10
|
@connection = nil
|
11
11
|
@q = nil
|
12
12
|
@qq = nil
|
13
|
+
block.call
|
13
14
|
end
|
14
15
|
|
15
16
|
def qq
|
data/lib/superbolt/version.rb
CHANGED
data/spec/app_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Superbolt::App do
|
4
4
|
let(:env) { 'test' }
|
5
5
|
let(:name) { 'superbolt' }
|
6
|
-
let(:logger) { Logger.new(
|
6
|
+
let(:logger) { Logger.new("/dev/null") }
|
7
7
|
let(:app) {
|
8
8
|
Superbolt::App.new(name, {
|
9
9
|
env: env,
|
@@ -24,7 +24,6 @@ describe Superbolt::App do
|
|
24
24
|
describe '#run' do
|
25
25
|
it "shuts down with any message to the quit queue" do
|
26
26
|
queue.push({please: 'stop'})
|
27
|
-
|
28
27
|
app.run do |arguments|
|
29
28
|
quit_queue.push({message: 'just because'})
|
30
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- socialchorus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.0.
|
155
|
+
rubygems_version: 2.0.2
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Superbolt is a gem that makes SOA intra-app communication easy, via RabbitMQ
|