nathanpeck / s3-upload-stream

A Node.js module for streaming data to Amazon S3 via the multipart upload API
MIT License
347 stars 46 forks source link

Why use 'uploaded' event instead of 'finish' #14

Closed kenperkins closed 10 years ago

kenperkins commented 10 years ago

The writeable stream spec on node.js docs state that a writeable stream should emit finish and readable should emit end. In s3-upload-stream you emit uploaded, but don't appear to use finish at all.

Can you enlighten me a bit on the motivations here?

nathanpeck commented 10 years ago

I don't think that was standardized in the spec yet when I coded the first version of this, so I just went with an appropriate sounding event name that matched what had happened. Then I was stuck using the "uploaded" event for backwards compatibility.

I'm not adverse to changing it.

shime commented 10 years ago

:+1:

maybe emit both finish and uploaded for backwards compatibility

nathanpeck commented 10 years ago

I have published version 1.0.2 which now emits a "finish" event in addition to the "uploaded" event. This will adhere to the spec while retaining backwards compatibility.