kantord / kantord/optative

process pool: parameterize over the inner Reconcile impl instead of hardcoding OptativeSet

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1
Forks
0
Avg merge
3d 5h
Merged PRs (30d)
17

Description

Came up while planning the optative-process-pool extraction.

ProcessPool currently wraps `OptativeSet` directly. The pool only ever calls `inner.reconcile()`, `inner.get()`, `inner.iter()`, and the Drop cleanup. All of those are on the `Reconcile` trait or close to it. Making the pool generic over `R: Reconcile` (with `OptativeSet` as the default) would let users swap in:

- a persistent store backend (state survives restarts)
- a sorted-iteration backend (BTreeMap)
- a mock store for tests

No trait redesign required. The Drop impl works unchanged because it just calls `inner.reconcile(vec![], ...)`.

Drafted by Claude (AI assistant) during a design review.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.