Description
What is the problem this feature will solve?
Because Buffer
s aren't immutable, any time a Buffer
is passed to something which will perform an asynchronous write, there is a concurrency hazard where the buffer could conceivably get modified before it gets a chance to be written. This can lead to bugs which are hard to track down. (I speak from experience.)
What is the feature you are proposing to solve the problem?
Anywhere where Buffer
is currently accepted for a write operation, e.g. and perhaps most notably stream.Writable.write()
and stream.Writable.end()
, also make it acceptable to pass a Blob
. Blob
s are always immutable.
What alternatives have you considered?
Just keep using Buffer
s, mostly keep my fingers crossed, and sometimes make copies of Buffer
s as a safeguard.
(Note: It also makes sense to have a way to optionally have Blob
s returned from readable streams, but I figure that'd be a different feature request.)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status