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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/patient_http/sidekiq.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e20cb0bf0d79d325dd9a236f246ceec4d9ab8c5cc948208ae33692d8e4d8b3cb
|
|
4
|
+
data.tar.gz: e3bb8edde618556e2a05e1f4d4269b1b2a547dd4df3d64d8ac18b5582a4dbdf4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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.
|
|
1
|
+
1.4.1
|
data/lib/patient_http/sidekiq.rb
CHANGED
|
@@ -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.
|
|
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:
|
|
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
|