Skip to content

Investigate applying backpressure to Stream-based input using queue depth #140

Closed

Description

@lovell

See #138.

When Streaming data into a sharp Object, the _write() method currently assumes unbounded memory and keeps accepting more data by near-instantly using the callback provided to it - see https://github.com/lovell/sharp/blob/master/index.js#L110

One possible solution might be to create a new sharp.queue object which emits a "queue depth changed" event. This could be used to delay calling the _write() callback until queueDepth <= UV_THREADPOOL_SIZE.

Activity

  1. lovell commented on Aug 18, 2016

    @lovell
    OwnerAuthor

    Closing as there's been no feedback on this fleeting thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions