$ show mizosoft/methanol
Methanol is an extensible HTTP client library built on Java's java.net.http package. It provides core HTTP functionality enhanced with features like automatic decompression (gzip, deflate, Brotli), pluggable body adapters for JSON/XML/Protobuf, HTTP caching with multiple backends (memory, disk, Redis), request/response interceptors, retry mechanisms, progress tracking, and Kotlin DSL support. The library follows a modular architecture with separate modules for core functionality, format adapters, extensions, and testing. Key entry points include Methanol.Builder for client creation, MutableRequest for request building, and BodyAdapter for encoding/decoding. Data flows involve request interception, body encoding, HTTP exchange via java.net.http, response interception, body decoding, and optional caching/progress tracking. External dependencies vary by module: core requires only JDK 11+, while adapters depend on libraries like Jackson/Gson/Moshi, extensions on Redis Lettuce or native Brotli, and testing on JUnit5/MockWebServer.
The LLM identified 5 files worth highlighting for reuse:
Comprehensive testing utilities including MockWebServerExtension, MemoryFileSystemProvider, MockClock/Delayer/Executor, TestSubscriber for reactive streams, and BodyAdapter/Encoder/Decoder verifiers. Isolated, reusable across projects for testing HTTP clients and reactive streams with minimal setup.
Simple executor that processes tasks sequentially in submission order. Self-contained, dependency-free, and easily extractable for any context requiring ordered task execution without thread pool overhead.
Disk-based cache with LRU eviction using concurrent hash map and linked list for O(1) operations. Provides transactional viewing/editing, handles concurrent access, and could be reused as a standalone cache solution for non-HTTP use cases.
Fluent builder for HTTP headers with intelligent handling of comma-separated values. Small, focused utility with zero external dependencies that simplifies header manipulation in any HTTP client/server code.
Predefined CharMatcher instances for HTTP token/separator characters. Encapsulates common HTTP parsing logic in a reusable, dependency-free utility applicable to any HTTP-related code.