patient_http-sidekiq 1.4.0 → 1.4.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: 0f463cc156486ac04ea624baf032e3ebd37d219149a720fd5044a864a9abf201
4
- data.tar.gz: 0b294c6cb0df108ca53fd872c71d284fd82ab0a42284769eb2af7f04ca25bd76
3
+ metadata.gz: e20cb0bf0d79d325dd9a236f246ceec4d9ab8c5cc948208ae33692d8e4d8b3cb
4
+ data.tar.gz: e3bb8edde618556e2a05e1f4d4269b1b2a547dd4df3d64d8ac18b5582a4dbdf4
5
5
  SHA512:
6
- metadata.gz: b9ab7cebbc773fb92baba7d58212a8fd3733392b4a93d995bdfa7ad3b03d70e1cd3637d8ebddc68c7178ca400b1adc1219ab65ef8cd3c7b9e4b852a0245b11e3
7
- data.tar.gz: 994e51c5f8d7df504f6be4ee32bdd1e32607e62672bf7f0d228d9758af8f2e1b473844063c20951726b4d2ccc37f5eae7549ce4a3796633004195a82af1bcc23
6
+ metadata.gz: ce53d2907c8f793ec468f02f747d9fb09b1386cdbaf47499158bfd5df14807d0d5599736da57b82b4c6d7d25422224fdfb92a338ae43e116479547911128d55d
7
+ data.tar.gz: 7e936ff57e3f6e71ee4bea13741d5e361b7d0f640187e33ce7309e08c18f605c5ec870c389cdf34dcbf53b2d97a3975fd543800cece6d30bb2e2ca90a338cd4e
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.4.1
8
+
9
+ ### Fixed
10
+
11
+ - The request handler is no longer unregistered when the processors stop. Sidekiq fires its `shutdown` event before its worker threads finish, so a job that submitted a request during the shutdown window raised `No request handler registered` and the request was lost. The handler now stays registered for the life of the process, and a request submitted after the processors have stopped is enqueued as a Sidekiq job and executed by the next process.
12
+
7
13
  ## 1.4.0
8
14
 
9
15
  ### Added
data/README.md CHANGED
@@ -331,7 +331,7 @@ end
331
331
 
332
332
  For classes that make many async HTTP requests, you can include `PatientHttp::RequestHelper` to get convenient instance methods like `async_get`, `async_post`, `async_put`, `async_patch`, and `async_delete`. You can also define a request template at the class level using the `request_template` class method to set shared options like `base_url`, `headers`, and `timeout`.
333
333
 
334
- When using this gem, the request handler is automatically registered when the processor starts and unregistered when it stops — no manual setup is required.
334
+ When using this gem, the request handler is automatically registered when you call `PatientHttp::Sidekiq.configure` or when the processor starts — no manual setup is required. The handler stays registered when the processor stops, so a request submitted while the process is shutting down is enqueued as a Sidekiq job and executed by the next process instead of being lost.
335
335
 
336
336
  ```ruby
337
337
  class NotificationService
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
@@ -383,15 +383,16 @@ module PatientHttp
383
383
  end
384
384
  end
385
385
 
386
- # Stop all processors gracefully
386
+ # Stop all processors gracefully.
387
+ #
388
+ # The request handler stays registered. Sidekiq fires its shutdown event while
389
+ # jobs are still running, and a job that submits a request after the processors
390
+ # have stopped must have it enqueued as a job for the next process rather than
391
+ # raise. Only {.reset!} removes the handler.
387
392
  #
388
393
  # @param timeout [Float, nil] maximum time to wait for in-flight requests to complete
389
394
  # @return [void]
390
395
  def stop(timeout: nil)
391
- if @request_handler
392
- PatientHttp.unregister_handler(@request_handler)
393
- end
394
-
395
396
  @lifecycle_mutex.synchronize do
396
397
  # Shared services can outlive the processors when a start failed part
397
398
  # way through, so tear them down whenever any of them exist.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patient_http-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 4.0.3
125
+ rubygems_version: 3.6.9
126
126
  specification_version: 4
127
127
  summary: Offload long-running HTTP requests from Sidekiq workers to a dedicated async
128
128
  I/O processor