Skip to content

Consider wrapping Stream.write calls with draining? #15

Closed
@justinwoo

Description

@justinwoo

due to the way Node Streams work, writing to a stream is apparently not even truly fire-and-forget: https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback (e.g. in https://github.com/purescript-node/purescript-node-streams/blob/master/src/Node/Stream.js#L144)

Maybe it might be worthwhile to use their drain event and just return a facade to downstream users for the Eff? e.g. https://github.com/owickstrom/hyper/blob/v0.8.0/src/Hyper/Node/Server.purs#L70

I ran into this while developing my vidtracker app and mashing Ctrl+R...

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