Skip to content

Use small chunks with toStream() #44

@huan

Description

@huan

Write a big chunk to stream will cause problems like block event loop

Especially here:

file-box/src/file-box.ts

Lines 492 to 495 in cf6caf5

private transformBufferToStream (buffer?: Buffer): Readable {
const bufferStream = new PassThrough()
bufferStream.end(buffer || this.buffer)
return bufferStream

Here's a solution: ChunkerTransformStream, a transform stream to take arbitrary chunk sizes and make them consistent

CC: @windmemory

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions