abstract class Awscr::S3::HttpClientFactory

Overview

Abstract factory for providing configured HTTP::Client instances used to communicate with AWS S3. This allows different implementations to manage client lifecycle — such as creating a new client per request, reusing a persistent connection, or implementing client pooling.

Direct Known Subclasses

Defined in:

awscr-s3/http_client_factory/http_client_factory.cr

Instance Method Summary

Instance Method Detail

def acquire_client(endpoint : URI, signer : Awscr::Signer::Signers::Interface) : HTTP::Client #

Acquires a fully configured HTTP::Client, with the signer attached.

Calls #acquire_raw_client internally to retrieve a client and automatically attaches a signing hook using the provided signer.

Override this method if you need custom logic beyond standard signing.


[View source]
abstract def acquire_raw_client(endpoint : URI) : HTTP::Client #

Acquires a raw HTTP::Client for the given endpoint and signer.

Subclasses must implement this method to construct or retrieve a client instance. The returned client is not expected to have a signing hook attached yet.


[View source]
def release(client : HTTP::Client | Nil) #

Releases the given HTTP client. This is called when the client is no longer needed.


[View source]