cf-message-bus 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cf_message_bus/mock_message_bus.rb +3 -3
- data/lib/cf_message_bus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b94ffc1cf8ce05972ef1a379d85dceed24f1445
|
4
|
+
data.tar.gz: 69f3396dd9525f9e5af0698995339e54525eed7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc6b734d5fe581a6bb7609eddc0d8608474eb6fa662252b7c192e95a3d7e2e1c976c4a9367d1f18d5db3c4996dcd288b8b4130f58229ef02a6f35ff73c58e0a4
|
7
|
+
data.tar.gz: a6de8e2871c1a8ec6532b3c02e77adc2af64a67503b24a5d5738ddcb04fc1ca225957bebd497ed26de14c25f75185d310e64ecc314634d4dcd5e717b68776997
|
@@ -4,11 +4,11 @@ module CfMessageBus
|
|
4
4
|
|
5
5
|
def initialize(config = {})
|
6
6
|
@logger = config[:logger]
|
7
|
-
@subscriptions = Hash.new { |hash, key| hash[key] = [] }
|
8
7
|
@requests = {}
|
9
8
|
@synchronous_requests = {}
|
10
9
|
@published_messages = []
|
11
10
|
@published_synchronous_messages = []
|
11
|
+
reset
|
12
12
|
end
|
13
13
|
|
14
14
|
def subscribe(subject, opts = {}, &blk)
|
@@ -17,7 +17,7 @@ module CfMessageBus
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def publish(subject, message = nil, inbox = nil, &callback)
|
20
|
-
@subscriptions
|
20
|
+
@subscriptions[subject].each do |subscription|
|
21
21
|
subscription.call(stringify_keys(message))
|
22
22
|
end
|
23
23
|
|
@@ -87,7 +87,7 @@ module CfMessageBus
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def reset
|
90
|
-
@subscriptions = {}
|
90
|
+
@subscriptions = Hash.new { |hash, key| hash[key] = [] }
|
91
91
|
end
|
92
92
|
|
93
93
|
private
|