mimi-messaging 1.1.0 → 1.1.1
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/lib/mimi/messaging.rb +5 -2
- data/lib/mimi/messaging/adapters/base.rb +6 -6
- data/lib/mimi/messaging/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: f4392d50097d139e224851c8d8609a7f3e092772
|
4
|
+
data.tar.gz: 587ba9c7a31e84d732e377c02df969dcecd2a296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c07418b84dc02e2e5d33cdf3c4b836b2aef84710ae6f53c539a99e918c3f5f488ee6efcd30e36b668dc81559808fed04baa9a6841cb5ebe8a5c9bc2d61c29c56
|
7
|
+
data.tar.gz: 8c7a7441e4b5eed3b2013daf7450f52cf9127449257b692508d8d3f6c580d4a695aa1a360b2cb3faa737b6680e3d4ed3298f5ab76fcb4189c2dfc3d82ee967a8
|
data/lib/mimi/messaging.rb
CHANGED
@@ -179,7 +179,7 @@ module Mimi
|
|
179
179
|
# Mimi::Messaging.command("users/create", name: "John Smith")
|
180
180
|
#
|
181
181
|
# @param target [String] "<queue>/<method>"
|
182
|
-
# @param message [Hash]
|
182
|
+
# @param message [Hash,Mimi::Messaging::Message]
|
183
183
|
# @param opts [Hash] additional adapter-specific options
|
184
184
|
#
|
185
185
|
# @return nil
|
@@ -196,6 +196,9 @@ module Mimi
|
|
196
196
|
#
|
197
197
|
# Raises Timeout::Error if the response from the target was not received in time.
|
198
198
|
#
|
199
|
+
# Example:
|
200
|
+
# result = Mimi::Messaging.query("users/find", id: 157)
|
201
|
+
#
|
199
202
|
# @param target [String] "<queue>/<method>"
|
200
203
|
# @param message [Hash,Mimi::Messaging::Message]
|
201
204
|
# @param opts [Hash] additional options, e.g. :timeout
|
@@ -213,7 +216,7 @@ module Mimi
|
|
213
216
|
# Broadcasts the event with the given target
|
214
217
|
#
|
215
218
|
# @param target [String] "<topic>/<event_type>", e.g. "customers/created"
|
216
|
-
# @param message [Hash]
|
219
|
+
# @param message [Hash,Mimi::Messaging::Message]
|
217
220
|
# @param opts [Hash] additional options
|
218
221
|
#
|
219
222
|
def self.event(target, message = {}, opts = {})
|
@@ -63,7 +63,7 @@ module Mimi
|
|
63
63
|
# Sends the command to the given target
|
64
64
|
#
|
65
65
|
# @param target [String] "<queue>/<method>"
|
66
|
-
# @param message [
|
66
|
+
# @param message [Mimi::Messaging::Message]
|
67
67
|
# @param opts [Hash] additional options
|
68
68
|
#
|
69
69
|
# @return nil
|
@@ -76,7 +76,7 @@ module Mimi
|
|
76
76
|
# Executes the query to the given target and returns response
|
77
77
|
#
|
78
78
|
# @param target [String] "<queue>/<method>"
|
79
|
-
# @param message [
|
79
|
+
# @param message [Mimi::Messaging::Message]
|
80
80
|
# @param opts [Hash] additional options, e.g. :timeout
|
81
81
|
#
|
82
82
|
# @return [Hash]
|
@@ -89,7 +89,7 @@ module Mimi
|
|
89
89
|
# Broadcasts the event with the given target
|
90
90
|
#
|
91
91
|
# @param target [String] "<topic>/<event_type>", e.g. "customers/created"
|
92
|
-
# @param message [
|
92
|
+
# @param message [Mimi::Messaging::Message]
|
93
93
|
# @param opts [Hash] additional options
|
94
94
|
#
|
95
95
|
def event(_target, _message, _opts = {})
|
@@ -124,7 +124,7 @@ module Mimi
|
|
124
124
|
raise(
|
125
125
|
ArgumentError,
|
126
126
|
"Invalid request processor passed to #{self.class}##{__method__}(), " \
|
127
|
-
"expected to respond to #call_command(
|
127
|
+
"expected to respond to #call_command(method_name, message, opts) AND #call_query(...)"
|
128
128
|
)
|
129
129
|
end
|
130
130
|
|
@@ -149,7 +149,7 @@ module Mimi
|
|
149
149
|
raise(
|
150
150
|
ArgumentError,
|
151
151
|
"Invalid event processor passed to #{self.class}##{__method__}(), " \
|
152
|
-
"expected to respond to #call_event(
|
152
|
+
"expected to respond to #call_event(event_type, message, opts)"
|
153
153
|
)
|
154
154
|
end
|
155
155
|
|
@@ -175,7 +175,7 @@ module Mimi
|
|
175
175
|
raise(
|
176
176
|
ArgumentError,
|
177
177
|
"Invalid event processor passed to #{self.class}##{__method__}(), " \
|
178
|
-
"expected to respond to #call_event(
|
178
|
+
"expected to respond to #call_event(event_type, message, opts)"
|
179
179
|
)
|
180
180
|
end
|
181
181
|
|