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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cf2b85c2edc9824535b2304c6a138c9fcb1f741514729c68f997bd11691b3cf
4
- data.tar.gz: 617e4142d0f55a1fa36b0c01accf4c4c620ac9816f6dc0f2ddde3e247fb6c16e
3
+ metadata.gz: fc2298d0987c599332f671cd0532398aa84df5e623492f480ba8845814713af4
4
+ data.tar.gz: 4186770cf7e9a235405f9245f7281c44c62bf0fb0adc83db6ccd6b86168d833d
5
5
  SHA512:
6
- metadata.gz: 8d2317b3bbf779296fde7e95e2982304cf6a23a2710e271539c1bfa2c2f107b5c77b5c07187c31ff85a59bce37b3cb2efcac1f60b8a276ad0c9009de1e9d1e19
7
- data.tar.gz: b8f2b58778e8dafab5c9811fabd6cba08f24b6b9f5f9c20814d9bc2252e44fc6c502a8fb6901a029ac36066cb392d610f1d6938da6db0a73b10d99a9d059707a
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Cinebase version
4
4
  module Cinebase
5
- VERSION = '5.4.0'
5
+ VERSION = '5.5.0'
6
6
  end
@@ -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
- Net::HTTP.start(uri.host, uri.port, use_ssl: true, open_timeout: 10, read_timeout: 30) do |http|
51
- http.request(request)
52
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Croll