carrot_rpc 0.7.0 → 0.7.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: 3aa31c8e652cfb85ca9ac63bfaff6139a0a76363
4
- data.tar.gz: 54258fe17ecb45ff2fcfb35438cc5247c38087c6
3
+ metadata.gz: f73f5b969d7493688ef3d27e5c25033da3ca1dbb
4
+ data.tar.gz: 6acc6663440edbc5656743c7f65e5a0504624d47
5
5
  SHA512:
6
- metadata.gz: 8b6f9404881d86dbecbc93ca34c717e6b3b173e71e4a35a2bf5925554397cf87307f74a87765c80d7e509999766c0422a3e9eee79667357dd66b214dcfc05be0
7
- data.tar.gz: c628f3b026f123530d3abe3ba5f5b5b49464a38e84814a06df73915d130b7f254caf98cd539852d3b13e4c8363cd1a7ba1316f0bc74fb0fcaab341ef602cd5fb
6
+ metadata.gz: 89f7ba93bc81ebffc4a48e7b2bc5064d55e8221355ce0b82d478df387f5deab61e5889f7b0f2793c606b0cdebe5523dc2261db821a8a0f942bc630d990366a2e
7
+ data.tar.gz: 8a754d6fc92c81227e00a8be6d6ef8311a6ab2f2a15eedc57304517855c3fc0c0a64c12110eb309fc0c20e39f9478a91f5efd953b7d03b98c2d98995d1f3e948
data/CHANGELOG.md CHANGED
@@ -3,41 +3,43 @@
3
3
  **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4
4
 
5
5
  - [Changelog](#changelog)
6
- - [v0.7.0](#v070)
6
+ - [v0.7.1](#v071)
7
7
  - [Bug Fixes](#bug-fixes)
8
+ - [v0.7.0](#v070)
9
+ - [Bug Fixes](#bug-fixes-1)
8
10
  - [Incompatible Changes](#incompatible-changes)
9
11
  - [v0.6.0](#v060)
10
12
  - [Enhancements](#enhancements)
11
13
  - [v0.5.1](#v051)
12
- - [Bug Fixes](#bug-fixes-1)
14
+ - [Bug Fixes](#bug-fixes-2)
13
15
  - [v0.5.0](#v050)
14
16
  - [Enhancements](#enhancements-1)
15
17
  - [Incompatible Changes](#incompatible-changes-1)
16
18
  - [v0.4.1](#v041)
17
- - [Bug Fixes](#bug-fixes-2)
19
+ - [Bug Fixes](#bug-fixes-3)
18
20
  - [v0.4.0](#v040)
19
21
  - [Enhancements](#enhancements-2)
20
- - [Bug Fixes](#bug-fixes-3)
22
+ - [Bug Fixes](#bug-fixes-4)
21
23
  - [Incompatible Changes](#incompatible-changes-2)
22
24
  - [v0.3.0](#v030)
23
25
  - [Enhancements](#enhancements-3)
24
- - [Bug Fixes](#bug-fixes-4)
26
+ - [Bug Fixes](#bug-fixes-5)
25
27
  - [v0.2.3](#v023)
26
28
  - [Enhancements](#enhancements-4)
27
- - [Bug Fixes](#bug-fixes-5)
29
+ - [Bug Fixes](#bug-fixes-6)
28
30
  - [Upgrading](#upgrading)
29
31
  - [v0.2.1](#v021)
30
- - [Bug Fixes](#bug-fixes-6)
32
+ - [Bug Fixes](#bug-fixes-7)
31
33
  - [v0.2.0](#v020)
32
34
  - [Enhancements](#enhancements-5)
33
- - [Bug Fixes](#bug-fixes-7)
35
+ - [Bug Fixes](#bug-fixes-8)
34
36
  - [Incompatible Changes](#incompatible-changes-3)
35
37
  - [v0.1.2](#v012)
36
38
  - [Enhancements](#enhancements-6)
37
- - [Bug Fixes](#bug-fixes-8)
39
+ - [Bug Fixes](#bug-fixes-9)
38
40
  - [v0.1.1](#v011)
39
41
  - [Enhancements](#enhancements-7)
40
- - [Bug Fixes](#bug-fixes-9)
42
+ - [Bug Fixes](#bug-fixes-10)
41
43
  - [Incompatible Changes](#incompatible-changes-4)
42
44
 
43
45
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -45,6 +47,10 @@
45
47
  # Changelog
46
48
  All significant changes in the project are documented here.
47
49
 
50
+ ## v0.7.1
51
+ ### Bug Fixes
52
+ * [#40](https://github.com/C-S-D/carrot_rpc/pull/41) - Deletes Queues immediately after the last consumer is unsubscribed. Reduces memory load. API remains the same. - [@shamil614](https://github.com/C-S-D/carrot_rpc/pull/34)
53
+
48
54
  ## v0.7.0
49
55
  ### Bug Fixes
50
56
  * [#38](https://github.com/C-S-D/carrot_rpc/pull/38) - The `until quit` busy-wait loop consumes ~1 core for each instance of `carrot_rpc` as the default `sleep 0` does the minimal amount of sleep before waking up to check the boolean `quit`. I've replaced it with an `IO.pipe` and `IO.select` that does not consume any resources while it waits. **NOTE: A Queue could not be used here because the MRI VM blocks use of Mutexes inside signal handlers to prevent deadlocks because the Mutex code is not-reentrant (i.e signal-interrupt-safe). If a Queue is used the thread silently fails with an exception and the signal is ignored.** - [@KronicDeth](https://github.com/KronicDeth)
@@ -62,27 +68,27 @@ All significant changes in the project are documented here.
62
68
 
63
69
  ## v0.5.1
64
70
  ### Bug Fixes
65
- * [#31](https://github.com/C-S-D/carrot_rpc/pull/31) - If the server does not respond to a method in the `request_message`, then return a "Method not found" JSONRPC 2.0 error instead of the server crashing with `NoMethodError` exception. - [KronicDeth)(https://github.com/KronicDeth)
71
+ * [#31](https://github.com/C-S-D/carrot_rpc/pull/31) - If the server does not respond to a method in the `request_message`, then return a "Method not found" JSONRPC 2.0 error instead of the server crashing with `NoMethodError` exception. - [@KronicDeth](https://github.com/KronicDeth)
66
72
 
67
73
  ## v0.5.0
68
74
  ### Enhancements
69
- * [#25](https://github.com/C-S-D/carrot_rpc/pull/25) - [shamil614](https://github.com/shamil614)
75
+ * [#25](https://github.com/C-S-D/carrot_rpc/pull/25) - [@shamil614](https://github.com/shamil614)
70
76
  * Timeout RpcClient requests when response is not received.
71
77
  * Default timeout is 5 seconds.
72
78
  * Timeout is configurable.
73
- * [#27](https://github.com/C-S-D/carrot_rpc/pull/27) - [shamil614](https://github.com/shamil614)
79
+ * [#27](https://github.com/C-S-D/carrot_rpc/pull/27) - [@shamil614](https://github.com/shamil614)
74
80
  * Simplify RpcClient usage.
75
81
  * Each request which goes through `RpcClient.remote_request` ultimately needs to use a unique `reply_queue` on eqch request.
76
82
  * By closing the channel and opening a new channel on each request we ensure that cleanup takes place by the deletion of the `reply_queue`.
77
- * [#29](https://github.com/C-S-D/carrot_rpc/pull/29) - [shamil614](https://github.com/shamil614)
83
+ * [#29](https://github.com/C-S-D/carrot_rpc/pull/29) - [@shamil614](https://github.com/shamil614)
78
84
  * Implementations of the RpcClient need to be flexible with the key formatter.
79
85
  * Formatting can be set globally via `Configuration`, overridden via passing Configuration object upon initializing client, or redefine `response_key_formatter` `request_key_formatter` methods.
80
86
 
81
87
  ### Incompatible Changes
82
- * [#27](https://github.com/C-S-D/carrot_rpc/pull/27) - [shamil614](https://github.com/shamil614)
88
+ * [#27](https://github.com/C-S-D/carrot_rpc/pull/27) - [@shamil614](https://github.com/shamil614)
83
89
  * Calling `rpc_client.start` and `rpc_client.channel.close` are no longer required when calling `rpc_client.remote_call` or the methods that call it (`index` `create`, etc).
84
90
  * Calling `rpc_client.channel.close` after `rpc_client.remote_call` will cause an Exception to be raised as the channel is already closed.
85
- * [#29](https://github.com/C-S-D/carrot_rpc/pull/29) - [shamil614](https://github.com/shamil614)
91
+ * [#29](https://github.com/C-S-D/carrot_rpc/pull/29) - [@shamil614](https://github.com/shamil614)
86
92
  * Replaced hard coded key formatter in place of a configurable option.
87
93
  * Need to set the following in config to maintain previous behavior
88
94
  ```ruby
@@ -96,39 +102,39 @@ All significant changes in the project are documented here.
96
102
 
97
103
  ## v0.4.1
98
104
  ### Bug Fixes
99
- * [#23](https://githb.com/C-S-D/carrot_rpc/pull/23) - [shamil614](https://github.com/shamil614)
105
+ * [#23](https://githb.com/C-S-D/carrot_rpc/pull/23) - [@shamil614](https://github.com/shamil614)
100
106
  * Fixes errors for non-hash results being called with hash methods.
101
107
  * RPC client parses response to account for jsonrpc error object as well as jsonrpc result object.
102
108
 
103
109
  ## v0.4.0
104
110
 
105
111
  ### Enhancements
106
- * [#20](https://githb.com/C-S-D/carrot_rpc/pull/20) - `config.before_request` may be set with a `#call(params) :: params` that is passed the `params` and returns altered `params` that are published to the queue. - [shamil614](https://github.com/shamil614)
112
+ * [#20](https://githb.com/C-S-D/carrot_rpc/pull/20) - `config.before_request` may be set with a `#call(params) :: params` that is passed the `params` and returns altered `params` that are published to the queue. - [@shamil614](https://github.com/shamil614)
107
113
 
108
114
  ### Bug Fixes
109
- * [#19](https://githb.com/C-S-D/carrot_rpc/pull/19) - [KronicDeth](http://github.com/kronicdeth)
115
+ * [#19](https://githb.com/C-S-D/carrot_rpc/pull/19) - [@KronicDeth](http://github.com/kronicdeth)
110
116
  * Put JSONAPI errors documents into the JSONRPC error fields instead of returning as normal results as consumers, such as `Rpc.Generic.Client` are expecting all errors to be in JSONRPC's error field and not have to check if the non-error `result` contains a JSONAPI level error. This achieves parity with the behavior in the Elixir `Rpc.Generic.Server`.
111
117
  * Scrub JSONAPI error fields that are `nil` so they don't get transmitted as `null`. JSONAPI spec is quite clear that `null` columns shouldn't be transmitted except in the case of `null` data to signal a missing singleton resource. This achieves compatibility with the error parsing in `Rpc.Generic.Client` in Elixir.
112
118
 
113
119
  ### Incompatible Changes
114
- * [#20](https://githb.com/C-S-D/carrot_rpc/pull/20) - `base_url`, which must be implemented by any RPC server that `include CarrotRpc::RpcServer::JSONAPIResources`, changes from `base_url() :: String` to `base_url(JSONAPI::OperationResult, JSONAPI::Request) :: String` - [shamil614](https://github.com/shamil614)
120
+ * [#20](https://githb.com/C-S-D/carrot_rpc/pull/20) - `base_url`, which must be implemented by any RPC server that `include CarrotRpc::RpcServer::JSONAPIResources`, changes from `base_url() :: String` to `base_url(JSONAPI::OperationResult, JSONAPI::Request) :: String` - [@shamil614](https://github.com/shamil614)
115
121
 
116
122
  ## v0.3.0
117
123
 
118
124
  ### Enhancements
119
- * [#11](https://githb.com/C-S-D/carrot_rpc/pull/11) - Add CodeClimate badge to README - [thewalkingtoast](https://github.com/thewalkingtoast)
120
- * [#13](https://githb.com/C-S-D/carrot_rpc/pull/13) - Document `queue_name` - [shamil614](https://github.com/shamil614)
121
- * [#14](https://githb.com/C-S-D/carrot_rpc/pull/14) - Pass `rpc_request: true` in the `JSONAPI::Request` `context`, so resources can differentiate between API and RPC calls - [shamil614](https://github.com/shamil614)
125
+ * [#11](https://githb.com/C-S-D/carrot_rpc/pull/11) - Add CodeClimate badge to README - [@thewalkingtoast](https://github.com/thewalkingtoast)
126
+ * [#13](https://githb.com/C-S-D/carrot_rpc/pull/13) - Document `queue_name` - [@shamil614](https://github.com/shamil614)
127
+ * [#14](https://githb.com/C-S-D/carrot_rpc/pull/14) - Pass `rpc_request: true` in the `JSONAPI::Request` `context`, so resources can differentiate between API and RPC calls - [@shamil614](https://github.com/shamil614)
122
128
 
123
129
  ### Bug Fixes
124
- * [#12](https://githb.com/C-S-D/carrot_rpc/pull/12) - Pass `request` to `render_errors` when handling exceptions in `CarrotRpc::RpcServer::JSONAPIResources` - [shamil614](https://github.com/shamil614)
125
- * [#15](https://githb.com/C-S-D/carrot_rpc/pull/15) - Fix argument error bug when passing block to `CarrotRpc::TaggedLog` methods by allowing either a message or a block like standard `Logger` interface - [shamil614](https://github.com/shamil614)
126
- * [#17](https://githb.com/C-S-D/carrot_rpc/pull/17) - New rubocop versions add new cops or deprecate old config settings, so it is not safe to have `"rubocop"` without a version in the gemspec. - [KronicDeth](http://github.com/kronicdeth)
130
+ * [#12](https://githb.com/C-S-D/carrot_rpc/pull/12) - Pass `request` to `render_errors` when handling exceptions in `CarrotRpc::RpcServer::JSONAPIResources` - [@shamil614](https://github.com/shamil614)
131
+ * [#15](https://githb.com/C-S-D/carrot_rpc/pull/15) - Fix argument error bug when passing block to `CarrotRpc::TaggedLog` methods by allowing either a message or a block like standard `Logger` interface - [@shamil614](https://github.com/shamil614)
132
+ * [#17](https://githb.com/C-S-D/carrot_rpc/pull/17) - New rubocop versions add new cops or deprecate old config settings, so it is not safe to have `"rubocop"` without a version in the gemspec. - [@KronicDeth](http://github.com/kronicdeth)
127
133
 
128
134
  ## v0.2.3
129
135
 
130
136
  ### Enhancements
131
- * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [KronicDeth](http://github.com/kronicdeth)
137
+ * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [@KronicDeth](http://github.com/kronicdeth)
132
138
  * `CarrotRpc::RpcServer` subclasses can `include CarrotRpc::RpcServer::JSONAPIResources` to get
133
139
  [`JSONAPI::ActsAsResourceController`](https://github.com/cerebris/jsonapi-resources/blob/8e85d68dfbaf9181344c7618b0b29b4cfd362034/lib/jsonapi/acts_as_resource_controller.rb)
134
140
  helper methods for processing JSONAPI requests in server methods.
@@ -147,14 +153,14 @@ All significant changes in the project are documented here.
147
153
  * `resource_klass`
148
154
 
149
155
  ### Bug Fixes
150
- * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [KronicDeth](http://github.com/KronicDeth)
156
+ * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [@KronicDeth](http://github.com/KronicDeth)
151
157
  * `CarrotRpc::Error` was moved from the incorrect `lib/carrot_rpc/rpc_server/error.rb`
152
158
  path to the correct `lib/carrot_rpc/error.rb` path.
153
159
  * `CarrotRpc::Error::Code` was moved from the incorrect `lib/carrot_rpc/rpc_server/error/code.rb`
154
160
  path to the correct `lib/carrot_rpc/error/code.rb` path.
155
161
 
156
162
  ### Upgrading
157
- * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [KronicDeth](http://github.com/KronicDeth)
163
+ * [#9](https://github.com/C-S-D/carrot_rpc/pull/9) - [@KronicDeth](http://github.com/KronicDeth)
158
164
  * If you previously loaded `CarrotRpc::Error` directly with `require "carrot_rpc/rpc_server/error"` you now need to
159
165
  `require "carrot_rpc/error"`, which is the corrected path. `CarrotRpc::Error` is autoloaded, so you don't need to require it.
160
166
  * If you previously loaded `CarrotRpc::Error::Code` directly with `require "carrot_rpc/rpc_server/error/code"`
@@ -165,19 +171,19 @@ All significant changes in the project are documented here.
165
171
  ## v0.2.1
166
172
 
167
173
  ### Bug Fixes
168
- * [#6](https://github.com/C-S-D/carrot_rpc/pull/6) - [shamil614](https://github.com/shamil614)
174
+ * [#6](https://github.com/C-S-D/carrot_rpc/pull/6) - [@shamil614](https://github.com/shamil614)
169
175
  * Error class not loaded in RpcServer
170
176
  * RpcServer should not rename json keys
171
177
  * RpcClient dasherizes keys before serializing hash to json. Better conformity to json property naming conventions.
172
178
  * RpcClient underscores keys after receiving response from server. Better conformity to ruby naming conventions.
173
- * [#7](https://github.com/C-S-D/carrot_rpc/pull/7) - [shamil614](https://github.com/shamil614)
179
+ * [#7](https://github.com/C-S-D/carrot_rpc/pull/7) - [@shamil614](https://github.com/shamil614)
174
180
  * Make sure hash keys are strings before renaming
175
181
 
176
182
 
177
183
  ## v0.2.0
178
184
 
179
185
  ### Enhancements
180
- * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [KronicDeth](http://github.com/KronicDeth)
186
+ * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [@KronicDeth](http://github.com/KronicDeth)
181
187
  * Gems ordered and documented in gemspec and `Gemfile`
182
188
  * Temorpary (`#`) files removed from git
183
189
  * Rubocop is enabled and used on CircleCI
@@ -226,12 +232,12 @@ All significant changes in the project are documented here.
226
232
  * Semantic block delimiters, so we always think about procedural vs functional blocks to make Elixir coding easier.
227
233
 
228
234
  ### Bug Fixes
229
- * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [KronicDeth](http://github.com/KronicDeth)
235
+ * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [@KronicDeth](http://github.com/KronicDeth)
230
236
  * `ClientServer::ClassMethods` has been moved under `CarrotRpc` namespace as `CarrotRpc::ClientServer`
231
237
  * `HashExtensions` has been moved under `CarrotRpc` namespace as `CarrotRpc::HashExtensions`
232
238
 
233
239
  ### Incompatible Changes
234
- * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [KronicDeth](http://github.com/KronicDeth)
240
+ * [#5](https://github.com/C-S-D/carrot_rpc/pull/5) - [@KronicDeth](http://github.com/KronicDeth)
235
241
  * `ClientServer::ClassMethods` renamed to `CarrotRpc::ClientServer`
236
242
  * `HashExtensions` renamed to `CarrotRpc::HashExtensions`
237
243
  * `ClientServer::ClassMethods#get_queue_name` renamed to `CarrotRpc::ClientServer#queue_name()` (no args is the reader, one argument is the writer)
@@ -239,21 +245,21 @@ All significant changes in the project are documented here.
239
245
  ## v0.1.2
240
246
 
241
247
  ### Enhancements
242
- * [#4](https://github.com/C-S-D/carrot_rpc/pull1) - [shamil614](https://github.com/shamil614)
248
+ * [#4](https://github.com/C-S-D/carrot_rpc/pull1) - [@shamil614](https://github.com/shamil614)
243
249
  * Rename the keys in the parsed payload from '-' to '_'
244
250
  * Added integration specs to test functionality
245
251
  * Logging to test.log file
246
252
  * Setup for circleci integration tests to rabbitmq
247
253
 
248
254
  ### Bug Fixes
249
- * [#4](https://github.com/C-S-D/carrot_rpc/pull1) - [shamil614](https://github.com/shamil614)
255
+ * [#4](https://github.com/C-S-D/carrot_rpc/pull1) - [@shamil614](https://github.com/shamil614)
250
256
  * Some require statements not properly loading modules
251
257
  * Consistent use of require vs require_relative
252
258
 
253
259
  ## v0.1.1
254
260
 
255
261
  ### Enhancements
256
- * [#1](https://github.com/C-S-D/carrot_rpc/pull1) - [shamil614](https://github.com/shamil614)
262
+ * [#1](https://github.com/C-S-D/carrot_rpc/pull1) - [@shamil614](https://github.com/shamil614)
257
263
  * `CarrotRpc.configuration.bunny` can be set to custom
258
264
  [`Bunny` instance](http://www.rubydoc.info/gems/bunny/Bunny#new-class_method).
259
265
  * `CarrotRpc::RpcClient` and `CarrotRpc::RpcServer` subclasses can set their queue name with the `queue_name` class
@@ -264,7 +270,7 @@ All significant changes in the project are documented here.
264
270
  is converted to a JSON RPC error and sent back to the client.
265
271
 
266
272
  ### Bug Fixes
267
- * [#1](https://github.com/C-S-D/carrot_rpc/pull/1) - [shamil614](https://github.com/shamil614)
273
+ * [#1](https://github.com/C-S-D/carrot_rpc/pull/1) - [@shamil614](https://github.com/shamil614)
268
274
  * Send `jsonrpc` key instead of incorrect `json_rpc` key in JSON RPC response messages
269
275
  * All files under `bin` are marked as gem executables instead of just `carrot_rpc`
270
276
  * Fix files not loading properly when using `carrot_rpc`
@@ -273,7 +279,7 @@ All significant changes in the project are documented here.
273
279
  `CarrotRpc::ServerRunner#run_servers` to prevent a race condition where `#start` may try to use the logger.
274
280
 
275
281
  ### Incompatible Changes
276
- * [#1](https://github.com/C-S-D/carrot_rpc/pull/1) - [shamil614](https://github.com/shamil614)
282
+ * [#1](https://github.com/C-S-D/carrot_rpc/pull/1) - [@shamil614](https://github.com/shamil614)
277
283
  * `CarrotRpc.configuration.bunny` **MUST** be set to a
278
284
  [`Bunny` instance](http://www.rubydoc.info/gems/bunny/Bunny#new-class_method), usually using `Bunny.new`.
279
285
  * `CarrotRpc::RpcClient` and `CarrotRpc::RpcServer` subclasses **MUST** set their queue name with the `queue_name`
@@ -49,7 +49,7 @@ class CarrotRpc::RpcClient
49
49
  def subscribe
50
50
  # Empty queue name ends up creating a randomly named queue by RabbitMQ
51
51
  # Exclusive => queue will be deleted when connection closes. Allows for automatic "cleanup".
52
- @reply_queue = @channel.queue("", exclusive: true)
52
+ @reply_queue = @channel.queue("", exclusive: true, auto_delete: true, durable: false)
53
53
 
54
54
  # setup a hash for results with a Queue object as a value
55
55
  @results = Hash.new { |h, k| h[k] = Queue.new }
@@ -1,3 +1,3 @@
1
1
  module CarrotRpc
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.7.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrot_rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Hamilton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-08 00:00:00.000000000 Z
12
+ date: 2016-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport