aws-sdk-http-async - Async HTTP transport for AWS SDK for Ruby using
async-http, built for fiber runtimes (Falcon/Async). It globally patches AWS
clients by default and falls back to Net::HTTP when no reactor is present.
All architectural decisions belong in md-docs/.
- Ruby 3.4+ only (
aws-sdk-core >= 3.241.0,async-http >= 0.94.0). - Pure gem (no Rails/ActiveRecord).
- Preserve Seahorse handler contract and error semantics.
- YARD docs required for public methods.
- No destructive git commands.
- Default:
:net_httpwhen no reactor exists. - Configurable:
Aws.config[:async_http_fallback] = :net_http | :sync | :raise. - ENV override:
AWS_SDK_HTTP_ASYNC_FALLBACK. - ENV force:
AWS_SDK_HTTP_ASYNC_FORCE_NET_HTTP. - Event streams always require Async reactor and use SDK HTTP/2 handler.
require 'aws-sdk-http-async/core'loads without auto-patching for explicit plugin usage.
:autostreams only rewindable + known-size bodies; buffers otherwise.:forcestreams all but raises if retries enabled and body non-rewindable.:offbuffers always.- Size order:
Content-Length->#bytesize->#length->#size. async_http_max_buffer_bytesdefault 5MB and enforced everywhere (Strings, buffers,StreamingBody#buffered).
- Per-reactor LRU (default 100) with
WeakRefto avoid stale reactors. - Cold-start gate removed (simple double-checked insert); duplicate builds are closed.
clear!/close!should run inside each reactor; outside reactor force-closes.
- Hostname verification enforced if
ssl_verify_peer. - Default CA store cached via
OpenSSL::X509::Store#set_default_paths. ssl_cert/ssl_keyaccept OpenSSL objects or file paths; empty strings raise.- File reads are blocking; prefer preloaded OpenSSL objects.
http_proxysupports Basic auth, CONNECT for HTTPS; no env proxy/PAC.- Proxy credentials hashed in cache key; percent-decoding preserves
+.
- Lowercase headers; strip
host,content-length. - Accept-Encoding forced empty only if absent.
- Set-Cookie + Set-Cookie2 joined with
\n; other duplicates join with,. http_open_timeout= connect;http_read_timeout= per-chunk read timeout.async_http_total_timeout= total request deadline (upload + headers + body).async_http_idle_timeoutis used as the endpoint timeout whenhttp_open_timeoutis unset.
bundle exec rake formatter
bundle exec rspec
bin/cibin/ci runs rufo, rubocop, rspec, bundler-audit, and brakeman (skips if no
Rails app).
- Proxy CONNECT integration test uses async-native harness (no
Timeout.timeout). - No special RSpec setup needed; Net::HTTP fallback covers reactorless contexts.
- Use
Sync {}in tests to exercise async-http path.
- Avoid blocking I/O inside reactor.
- Avoid threads for I/O; use Async primitives.
- Use
rgfor search.
require 'aws-sdk-http-async'
client = Aws::DynamoDB::Client.new
client.list_tables