clj-commons / clj-commons/aleph
"Closable" HTTP client instance
- Dominant language
- Clojure
- Stars
- 2.6k
- Forks
- 242
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 1
Description
In some cases, you need to be able to clean up all resources allocated by the HTTP client: close all open connections, shutdown appropriate threads etc. It's useful and desirable e.g. when your application has some kind of lifecycle management or when implementing a library that targets to be a good citizen for your JVM.
All of that is kinda tricky with Aleph, as we do not have any specific notion of "client instance" at all, at least in a way we do for the server. By default, HTTP request goes to a default shared connections pool and operates on shared Netty's threads group. But we can expose another API that creates a reified `Closable` instance that you can use to call `.close` when necessary (like we do to shut down a server), uses provided instance of a connection pool or newly created one (but never shared), spawns separate Netty's group to shutdown it when necessary.
Contributor guide
Research direction
Start by reading Aleph's existing HTTP client behavior, shared connection-pool handling, and server shutdown API; the issue names no files or tests. Done means a reified client instance can close its own connections and dedicated Netty threads without affecting shared resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100