Skip to content

v7.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Jun 21:46
3cdf0a4

Release v7.1.0

  • Bump type: minor
  • Previous: 7.0.0
  • Next: 7.1.0
  • Trigger: workflow_dispatch

Install with: gem install getstream-ruby -v 7.1.0

Highlights: connection pooling (CHA-2956)

The default Faraday adapter is now :net_http_persistent with a per-process connection pool (restoring parity with the legacy stream-chat-ruby client). Previously every thread funneled through a single unpooled connection, which serialized requests and showed up as latency under production concurrency.

Example

require 'getstream_ruby'

# Defaults: pooled, persistent connections (max_conns_per_host: 5).
client = GetStreamRuby.manual(
  api_key: ENV.fetch('STREAM_API_KEY'),
  api_secret: ENV.fetch('STREAM_API_SECRET'),
)

# Tune the pool to match your Puma/Sidekiq thread count to avoid contention:
client = GetStreamRuby.manual(
  api_key: ENV.fetch('STREAM_API_KEY'),
  api_secret: ENV.fetch('STREAM_API_SECRET'),
  max_conns_per_host: Integer(ENV.fetch('RAILS_MAX_THREADS', 5)), # pool size
  idle_timeout: 55,      # seconds an idle connection is kept open
  connect_timeout: 10,   # seconds to establish a TCP connection
  request_timeout: 30,   # seconds per request
)

# Per-call timeout override (no client rebuild):
client.make_request(:get, '/api/v2/some/path', request_timeout: 5)

The same knobs can be set via env vars: STREAM_MAX_CONNS_PER_HOST, STREAM_IDLE_TIMEOUT, STREAM_CONNECT_TIMEOUT, STREAM_REQUEST_TIMEOUT. On construction the client emits one INFO log line listing the effective pool config so you can confirm net_http_persistent is active in production.