Expand description
Common types and utilities for HTTP client providers.
This module provides a reusable connection pooling implementation that can be used by both the internal and external wasmCloudHTTP client providers. It manages separate pools for HTTP and HTTPS connections, allowing for efficient connection reuse.
Structs§
- Conn
Pool - Manages separate pools for HTTP and HTTPS connections, allowing for efficient connection reuse based on the target authority.
- Pooled
Conn - Represents a connection to a remote HTTP server that can be reused across multiple requests. Includes the actual sender for making requests, a handle to abort the connection task, and a timestamp for tracking when the connection was last used for connection pooling.
Enums§
- Cacheable
- Represents a cacheable result that can either be a miss or a hit. Used to handle connection caching in the HTTP client provider.
Constants§
- DEFAULT_
CONNECT_ TIMEOUT - Default HTTP connection timeout.
- DEFAULT_
FIRST_ BYTE_ TIMEOUT - Default first byte timeout for HTTP connections (causingHTTP 503 errors).
- DEFAULT_
IDLE_ TIMEOUT - Default duration after which idle connections are closed.
- DEFAULT_
USER_ AGENT - Default User-Agent header value for HTTP requests.
- LOAD_
NATIVE_ CERTS - Configuration key to control whether to load the system’s native certificate store. When set to “true” (default), the provider will use the operating system’s trusted certificates.
- LOAD_
WEBPKI_ CERTS - Configuration key to control whether to load the webpki certificate store. When set to “true”, the provider will use the Mozilla-curated certificate store bundled with webpki-roots.
- SSL_
CERTS_ FILE - Configuration key to specify a custom TLS certificate CA bundle file. When provided, the provider will load certificates from this file in addition to other sources.
Statics§
- ZERO_
INSTANT - Instant used as the “zero”
last_seenvalue. Provides a consistent starting point for measuring connection age.
Functions§
- evict_
conns - Evicts connections from the pool that have been idle for longer than the cutoff time.
- hyper_
request_ error - Translate a
hyper::Errorto a wRPC HTTP error code.
Type Aliases§
- Conn
Pool Table - Type alias for the connection pool’s internal storage structure. Maps authority strings (e.g., “example.com:443”) to queues of pooled connections for efficient connection reuse.