Skip to content

Vendored threadspawn and iterator - #177

Merged
dryajov merged 31 commits into
mainfrom
feat/vendored-threadspawn-iter
Aug 19, 2026
Merged

dryajov merged 31 commits into
mainfrom
feat/vendored-threadspawn-iter

Conversation

@dryajov

@dryajov dryajov commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Extract threadspawn and iterators to own packages

@greptile-apps

greptile-apps Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR extracts the local iterator and thread-spawn utilities into newly vendored packages and migrates their consumers to the package APIs.

  • Adds iter and threadspawn submodules and removes the corresponding local utility implementations and tests.
  • Migrates repository iteration APIs from SafeAsyncIter to the vendored AsyncIter.
  • Moves task-pool operations in networking, erasure coding, Merkle construction, NAT traversal, and proof generation onto the vendored spawnJoin result channel.
  • Adds explicit handling for SpawnContractError and iterator exceptions at affected boundaries.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the available follow-up review record.

No blocking failure remains.

Important Files Changed

Filename Overview
.gitmodules Registers the new iterator and threadspawn package submodules.
archivist/merkletree/asyncbuilder.nim Replaces explicit batch contexts and signal management with spawnJoin futures and result-channel delivery.
archivist/erasure/erasure.nim Refactors encoding and decoding workers to borrow prepared buffers and return generated sequences through spawnJoin.
archivist/blockexchange/network/networkpeer.nim Migrates large-message encoding and decoding to the vendored threadspawn API with contract-error handling.
archivist/stores/queryiterhelper.nim Adapts kvstore query iterators to the vendored AsyncIter interface and maps disposal errors into iterator exceptions.
archivist/stores/repostore/overlays/overlays.nim Migrates overlay listing and collection to vendored asynchronous iterator operations.
archivist/stores/repostore/store.nim Changes block listing to return the vendored AsyncIter and translates query failures into raised iterator errors.
vendor/nimble/iter Pins the external iterator package, whose source is not materialized in this workspace.
vendor/nimble/threadspawn Pins the external threadspawn package, whose source is not materialized in this workspace.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Archivist call sites] --> B[pkg/iter]
  A --> C[pkg/threadspawn]
  B --> D[Async repository queries]
  C --> E[Taskpool workers]
  E --> F[SpawnJoin result channel]
Loading

Reviews (7): Last reviewed commit: "vendor: re-pin nim-kvstore to 0.2.0" | Re-trigger Greptile

@dryajov dryajov changed the title endored threadspawn and iterator Vendored threadspawn and iterator Aug 18, 2026
@dryajov
dryajov force-pushed the feat/vendored-threadspawn-iter branch 4 times, most recently from 730e030 to e93004f Compare August 19, 2026 02:18
@dryajov
dryajov force-pushed the feat/vendored-threadspawn-iter branch from e93004f to 6ee69fc Compare August 19, 2026 02:27
Matches the nim-kvstore lock pin; single commit (nimble.paths generation in the test task).
@dryajov
dryajov merged commit 2a3edca into main Aug 19, 2026
37 checks passed
@dryajov
dryajov deleted the feat/vendored-threadspawn-iter branch August 19, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant