How sneako/finch works
Main Components
a. Client Interface Layer:
• Entry point through Finch module
• Request builder and response handlers
• Configuration management
b. Pool Management Layer:
• Pool Manager (handles connection pool lifecycle)
• Pool implementations (HTTP/1 and HTTP/2)
• Connection pooling strategies
c. Protocol Handlers:
• HTTP/1 implementation
• HTTP/2 implementation
• SSL/TLS handling
d. Monitoring & Instrumentation:
• Telemetry integration
• Pool metrics
• Error handling
┌─────────────────────────────────────────┐
• Client Application │
• ┘
• ↓
┌─────────────────────────────────────────┐
• Finch Public API │
• (build/request/start_link interfaces) │
• ┘
• ↓
┌─────────────────────────────────────────┐
• Pool Manager Layer │
• ┐ ┌───────────────┤
• HTTP/1 Pool │ │ HTTP/2 Pool │
• ┘ └───────────────┘
• ↓
┌─────────────────────────────────────────┐
• Protocol Handlers │
• ┐ ┌───────────────┤
• HTTP/1 Handler │ │HTTP/2 Handler │
• ┘ └───────────────┘
• ↓
┌─────────────────────────────────────────┐
• Mint (HTTP Client) │
• ┘
Important Relationships to Highlight
• How requests flow from the public API through the pool manager to the appropriate protocol handler
• Relationship between pools and their respective protocol implementations
• Demonstrate how telemetry events are emitted at various points
• Connection pooling strategy with multiple instances
Additional Elements
A separate section showing:
• Configuration options
• Telemetry events
• SSL/TLS handling
• Pool metrics collection points
Key Architectural Patterns to Emphasize
• Pool-based connection management
• Protocol-specific implementations
• Supervisor tree structure
• Event-based monitoring
Implementation Details
• lib/finch.ex as the main entry point
• lib/finch/http1 and lib/finch/http2 as separate protocol implementations
• lib/finch/pool.ex and lib/finch/pool_manager.ex for connection management
• lib/finch/telemetry.ex for instrumentation
• Keep the main flow clear and centered
• Pool configuration examples
• Error handling paths
• Demonstrate how the library integrates with external applications
• Notes about performance optimization points
• Connection pooling strategy as it's a key feature