patient_http-solid_queue 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3dff2ec8890085fac33d90459fae8756ba79fbf357579ac1cacb71a49f7e8fe
4
- data.tar.gz: 8664f9bad61dc7db22fd7e3908ea705b094703863e9d13598f0f787e91e6d1f9
3
+ metadata.gz: 1c4ac3bbb362f31671cf29f2ceb4f848c691a810fe0ee5a75cdb688a8e3496b7
4
+ data.tar.gz: 38743ad3ff5bf5a28d59b0b2de7f4d023d5d06deee198dcfc90d596682453976
5
5
  SHA512:
6
- metadata.gz: 106fc849d06ab190c8d691cf4f99066bd7fcc6c3cc0be20da1a95a43fbc73e4ff7cb1517a555bd008c4a55113394096985eb58835c04a579be098b371f2fdb14
7
- data.tar.gz: 502cd86c858693f6c70edc88a97e2cae08e9a6f85712dc7f2fb06d5066124ae679351e7b685fa4fba4a4c0da97020f096c3673ca451aa768b329d2c7b01d61a3
6
+ metadata.gz: bbd0c898f04fca1cc69fb8e43d2af88f48003975a3d27cd91d89aacad9fb1da7fbbcb2299d51f81b8c04bbf892893982f4a63820ae47644f0492d165f231ae32
7
+ data.tar.gz: c36e0b07297193eebe1b42c25890f51d7b6d0df33304f2e57a53e8c94605c662c8db97cb3bd5641b66c40fea2cd32aac7f76d5eee38e3e77c58f21850da875be
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 1.0.1
8
+
9
+ ### Fixed
10
+
11
+ - Ensure `PatientHttp::SolidQueue` is automatically registered as the HTTP processor on a process not running the SolidQueue server. This gem will now auto register itself on a client process either by calling `PatientHttp::SolidQueue.configure` or `PatientHttp::SolidQueue.register_handler` directly.
12
+
7
13
  ## 1.0.0
8
14
 
9
15
  ### Added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -66,6 +66,7 @@ module PatientHttp
66
66
  def configure
67
67
  configuration = Configuration.new
68
68
  yield(configuration) if block_given?
69
+ register_handler
69
70
  @configuration = configuration
70
71
  end
71
72
 
@@ -173,16 +174,7 @@ module PatientHttp
173
174
  @processor.observe(ProcessorObserver.new(@processor))
174
175
  @processor.start
175
176
 
176
- @request_handler ||= lambda do |request:, callback:, raise_error_responses:, callback_args:|
177
- execute(
178
- request,
179
- callback: callback,
180
- raise_error_responses: raise_error_responses,
181
- callback_args: callback_args
182
- )
183
- end
184
-
185
- PatientHttp.register_handler(@request_handler)
177
+ register_handler
186
178
  end
187
179
 
188
180
  # Signal the processor to drain (stop accepting new requests).
@@ -216,7 +208,6 @@ module PatientHttp
216
208
  def reset!
217
209
  if @request_handler
218
210
  PatientHttp.unregister_handler(@request_handler)
219
- @request_handler = nil
220
211
  end
221
212
  @processor&.stop(timeout: 0)
222
213
  @processor = nil
@@ -226,6 +217,23 @@ module PatientHttp
226
217
  @after_error_callbacks = []
227
218
  end
228
219
 
220
+ # Register SolidQueue as the request handler for processing HTTP requests. This is called
221
+ # automatically when the processor starts or you call PatientHttp::SolidQueue.configure.
222
+ #
223
+ # @return [void]
224
+ def register_handler
225
+ @request_handler ||= lambda do |request:, callback:, raise_error_responses:, callback_args:|
226
+ execute(
227
+ request,
228
+ callback: callback,
229
+ raise_error_responses: raise_error_responses,
230
+ callback_args: callback_args
231
+ )
232
+ end
233
+
234
+ PatientHttp.register_handler(@request_handler)
235
+ end
236
+
229
237
  # Invoke the registered completion callbacks.
230
238
  #
231
239
  # @param response [PatientHttp::Response] the HTTP response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patient_http-solid_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand