Skip to content

Improvement suggestions #8

@ghost

Description

Unsubscribe single-use event handlers after use

--stream.on('close', closeHandler);
--stream.on('end', closeHandler);
++stream.once('close', closeHandler);
++stream.once('end', closeHandler);

Avoid unnecessary closure

    stream.on('data', function(data) {
      tasks.push(data);
      if (running < concurrency) {
        startNextTask();
      } else {
--        stream.pause();
++        this.pause();
      }
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions