Optimal Pooling Strategy
Open
Nobody has claimed this yet.
enhancement
Pool
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 880
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 68
Description
What is the optimal strategy when picking the next client to perform a request on in the pool?
I believe the follow sorting criteria would be best:
const next = clients
.sort((a, b) => {
// connected
if (a.connected !== b.connected) return a.connected ? -1 : 1
// queue size
if (a.size !== b.size) return a.size - b.size
// drained timestamp
if (a.drained !== b.drained) return b.drained - a.drained
return 0
})
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no file, test, or entry point. First locate the pool's client-selection logic and compare its current behavior with the proposed connected, queue-size, and drained-time ordering; done requires an agreed strategy and corresponding validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100