Skip to content

Sparse read streams#56

Draft
danielchrist0pher wants to merge 9 commits into
mainfrom
local-read-stream
Draft

Sparse read streams#56
danielchrist0pher wants to merge 9 commits into
mainfrom
local-read-stream

Conversation

@danielchrist0pher

@danielchrist0pher danielchrist0pher commented Jun 26, 2026

Copy link
Copy Markdown
Member

API

  • createReadStream({ wait })

Options

  • wait: false - returns only local entries
  • wait: true - returns all entries and fetches blocks if necessary

Cache

Currently should manually clear the cache between localOnly and normal streams to avoid missing blocks ( ex - if subtrees are cached as null during a local only stream, this could cause gaps in a normal read stream )

Comment thread index.js Outdated
Comment thread lib/context.js
if (core === 0) return this
if (core > this.cores.length) await this.update(config)
if (core > this.cores.length) {
if (!config.wait) return null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some scenarios outside inflate that use this. Do those account for null as a value returned?

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.

2 participants