feat(messaging-streams): manually deepen all six stream utility modules
- chunker: framed seq chunks, reassemble, setChunkSize - multiplex: closeAll, getStream, per-stream byte counters - backpressure: low/high water marks, bufferedBytes - tee: branchBytes, removeBranch, depth guard - transform: pipeTo and outbound backpressure - resume-token: labeled checkpoints, clearTokens, bytesFromOffset - Update category README and chunker tests Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -8,7 +8,16 @@ test('split chunks', async (t) => {
|
||||
const m = new HyperP2PStreamChunker({ chunkSize: 4 })
|
||||
const parts = m.push(require('b4a').from('abcdefgh'))
|
||||
t.is(parts.length, 2)
|
||||
t.is(parts[0].length, 4)
|
||||
t.is(parts[0].data.length, 4)
|
||||
t.is(parts[0].seq, 0)
|
||||
await m.close()
|
||||
})
|
||||
|
||||
test('reassemble', async (t) => {
|
||||
const m = new HyperP2PStreamChunker({ chunkSize: 3 })
|
||||
m.push(require('b4a').from('hello'))
|
||||
m.flush()
|
||||
t.is(m.reassemble().toString(), 'hello')
|
||||
await m.close()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user