mimi-messaging 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mimi/messaging/mock.rb +1 -0
- data/lib/mimi/messaging/mock/request.rb +18 -0
- data/lib/mimi/messaging/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839a61eb8dc38069954026c340bdbd6a530a8542
|
4
|
+
data.tar.gz: faecf24ec54b10447d81b48ca1794438a6d3cf0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b73ee235bc27d40cba7209e4049fd52f50ab8499a85243053bc12f3e7320d8730ad2072af3a91803354fa0472775ac857c21521b824fd62031d8bee7899363ba
|
7
|
+
data.tar.gz: 958de3483a20f933c134b68c0061b632533db04993608f11f75b9b02093017c6e79bee89917b196d56931bb1b52aa8308afeb298474385565450d5ac45d6d099
|
data/lib/mimi/messaging/mock.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Mimi
|
2
|
+
module Messaging
|
3
|
+
class Request
|
4
|
+
attr_reader :response
|
5
|
+
|
6
|
+
def send_response(data = {})
|
7
|
+
return if !get? || replied?
|
8
|
+
raise ArgumentError, 'Invalid response format, Hash is expected' unless data.is_a?(Hash)
|
9
|
+
raw_message = Mimi::Messaging::Message.encode(data)
|
10
|
+
@response = Mimi::Messaging::Message.decode(raw_message)
|
11
|
+
request_processor.connection.post(
|
12
|
+
reply_to_queue_name, raw_message, correlation_id: metadata[:correlation_id]
|
13
|
+
)
|
14
|
+
@replied = true
|
15
|
+
end
|
16
|
+
end # class Request
|
17
|
+
end # module Messaging
|
18
|
+
end # module Mimi
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimi-messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kukushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/mimi/messaging/message.rb
|
153
153
|
- lib/mimi/messaging/mock.rb
|
154
154
|
- lib/mimi/messaging/mock/connection.rb
|
155
|
+
- lib/mimi/messaging/mock/request.rb
|
155
156
|
- lib/mimi/messaging/mock/request_processor.rb
|
156
157
|
- lib/mimi/messaging/model.rb
|
157
158
|
- lib/mimi/messaging/model_provider.rb
|