Skip to content

writable streams prevent async-done from detecting completion #19

@RoystonS

Description

@RoystonS

(I'm assuming that the intent of async-done, when given a stream, is to detect when the stream has finished emitting data. If that's not true, this bug report is invalid.)

I've been trying to diagnose a curious problem with a combination of merged streams (using the event-stream module) and have come across a case where async-done doesn't detect that a stream has finished emitting data.

If the stream reports itself as writable, the end-of-stream module, by default, waits for both the readable side to complete (via an 'end' or 'close' event) and for the writable side to complete (via a 'finish' event). The read/write streams returned by event-stream#merge don't ever complete their write side, so async-done never detects that the stream has finished (emitting).

Changing the EOS configuration in async-done to include 'writable': false tells end-of-stream that we don't care whether the stream is still writable, i.e.

var eosConfig = {
  error: false,
  writable: false
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions