cinebase 5.4.0 → 5.5.0
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 +4 -0
- data/lib/cinebase/version.rb +1 -1
- data/lib/cinebase/vista/client.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc2298d0987c599332f671cd0532398aa84df5e623492f480ba8845814713af4
|
|
4
|
+
data.tar.gz: 4186770cf7e9a235405f9245f7281c44c62bf0fb0adc83db6ccd6b86168d833d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a5309228e4f27451c1a00fecee37b386e8aaabb9131a5447776d1ccdb4bc009c6f4fd7cd379cd204eced5ae2dc6417d41d8bb5f13e6f0e1dddd97e0dc828bfb
|
|
7
|
+
data.tar.gz: f6f1b180642f3e65adaa143be1c3f95c25aa73e3788221aaf43f9fb55eb5da65488ca5bf615ff9d5953231c8d76d6fc88350de5a0f4ea0abbe5b575289b55289
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [5.5.0] - 2026-10-22
|
|
6
|
+
### Changed
|
|
7
|
+
- `Vista::Client` keeps one connection open for all its requests instead of opening a new TLS connection each time, which cost over ten times the request itself. Requests on one client are serialised, so a client can be shared between threads.
|
|
8
|
+
|
|
5
9
|
## [5.4.0] - 2026-10-22
|
|
6
10
|
### Added
|
|
7
11
|
- `Vista::Client` accepts `region_code: nil` and then sends no `Connect-Region-Code` header, for chains such as Picturehouse whose API rejects every region code
|
data/lib/cinebase/version.rb
CHANGED
|
@@ -15,6 +15,7 @@ module Cinebase
|
|
|
15
15
|
@base_url = base_url
|
|
16
16
|
@region_code = region_code
|
|
17
17
|
@token = token
|
|
18
|
+
@mutex = Mutex.new
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
# @param [String] path relative to the base URL
|
|
@@ -47,9 +48,15 @@ module Cinebase
|
|
|
47
48
|
request['Authorization'] = "Bearer #{@token}"
|
|
48
49
|
request['Connect-Region-Code'] = @region_code if @region_code
|
|
49
50
|
request['Accept'] = 'application/json'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
@mutex.synchronize { connection(uri).request(request) }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# A new TLS connection per request costs over ten times the request
|
|
55
|
+
# itself. Net::HTTP reconnects after its keep-alive timeout and retries
|
|
56
|
+
# a GET once on a dropped connection.
|
|
57
|
+
def connection(uri)
|
|
58
|
+
@connection ||= Net::HTTP.start(uri.host, uri.port, use_ssl: true,
|
|
59
|
+
open_timeout: 10, read_timeout: 30)
|
|
53
60
|
end
|
|
54
61
|
end
|
|
55
62
|
end
|