⚠️ 这是 GitHub 的第三方镜像站点,非官方页面。请勿在此输入密码、Token 或任何敏感信息。返回镜像首页
Skip to content

Readable stops reading #26097

Closed
Closed

Description

@lpinca
  • Version: >= 10.0.0
  • Platform: any
  • Subsystem: stream

Consider the following example, born from discussion in #25969.

const { Readable } = require('stream');

const buf = Buffer.alloc(8192);

const readable = new Readable({
  read() {
    this.push(buf);
  }
});

readable.on('readable', function() {
  const data = readable.read();
  console.log(data.length);
});

Note that readable.read() is not called in a loop on purpose.

Expected behavior

An endless loop. This works as expected in Node.js < 10.0.0.

Actual behavior

Reading stops after a few reads.


Bisecting points to this commit: 0778f79.

Activity

  1. added
    stream
    on Feb 14, 2019
  2. targos commented on Feb 14, 2019

    @targos
    Member

    @nodejs/streams

  3. mcollina commented on Feb 28, 2019

    @mcollina
    SponsorMember

    Fixed in cd302d7.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions