class

EasyAwscr::CloudWatch::Internals::ConnectionPool

Inherits Awscr::CloudWatch::DefaultHttpClientFactory < Awscr::CloudWatch::HttpClientFactory < Reference < Object

Keeps one connection per fiber and drops idle ones. The clients themselves come from the default factory, so timeouts and the shared TLS context stay the same.

Constants

DEFAULT_MAX_TTL = 3.seconds

Not confirmed by official sources, but in tests it took around 5 seconds until CloudWatch closes an idle connection. That means, we need to stay below that number.

Constructors

new(*, max_ttl : Time::Span | Nil = DEFAULT_MAX_TTL, max_size : Int32 = 128)
Source

Instance methods

acquire_client(endpoint : URI) : HTTP::Client

Returns a client for endpoint. Requests are signed by the caller, so handing out the same client again is fine, but never to two fibers at once.

Source
close
Source
created_at
Source
release(client : HTTP::Client | Nil)

Called once the request is done, also when it failed.

Source