Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upreadable-stream #21
Comments
This comment has been minimized.
This comment has been minimized.
|
I thought that the old stream interface was still gonna work, too? |
This comment has been minimized.
This comment has been minimized.
|
@dominictarr yes it will be fully backwards compatible. But I want to make a clean break and write all my new streams in the readable-stream interface. From my point of view all modules based on the old stream will be considered legacy. |
This comment has been minimized.
This comment has been minimized.
eshao
commented
May 24, 2013
|
Has this been resolved? I upgraded from node v0.8 to node v0.10 and my modules depending on event-stream are broken in a few edge cases: For example, put the following into two seperate files. When doing module.exports = function(data, callback) {
// do some work here
return callback(null, data)
}
if (require.main === module) {
es.pipeline(
process.stdin
, es.split()
, es.parse()
, es.map(module.exports)
, es.stringify()
, process.stdout
)
}
_stream_readable.js:735
while (!paused && (null !== (c = stream.read())))
^
TypeError: Property 'read' of object #<Socket> is not a function
at Socket.<anonymous> (_stream_readable.js:735:45)
at Socket.EventEmitter.emit (events.js:92:17)
at emitDataEvents (_stream_readable.js:761:10)
at Socket.Readable.on (_stream_readable.js:682:5)
at proxyStream (/Volumes/Shared_HD/Users/eshao/wsp/kites/src/kites-analytics/node_modules/event-stream/node_modules/stream-combiner/node_modules/duplexer/index.js:65:16)
at Array.forEach (native)
at duplex (/Volumes/Shared_HD/Users/eshao/wsp/kites/src/kites-analytics/node_modules/event-stream/node_modules/stream-combiner/node_modules/duplexer/index.js:26:16)
at Object.module.exports (/Volumes/Shared_HD/Users/eshao/wsp/kites/src/kites-analytics/node_modules/event-stream/node_modules/stream-combiner/index.js:8:17)
at Object.<anonymous> (/Volumes/Shared_HD/Users/eshao/wsp/kites/src/kites-analytics/bin/freshness.js:51:39)
at Module._compile (module.js:456:26) |
This comment has been minimized.
This comment has been minimized.
|
does this only happen when piping in bash? what about if you pipe directly? I do not plan to rewrite all this in streams2, but i'll merge a pull request. I'd recommend using the stream-serializer module instead, var serialize = require('stream-serializer')()
process.stdin.pipe(serialize(es.map(fun))).pipe(process.stdout) |
This comment has been minimized.
This comment has been minimized.
eshao
commented
May 25, 2013
|
It also happens if you spawn a child and pipe between the children. If I pipe all in one file, then it works. |
This comment has been minimized.
This comment has been minimized.
|
can you post a script to reproduce? On Sat, May 25, 2013 at 6:12 AM, Edwin Shao notifications@github.comwrote:
|
This comment has been minimized.
This comment has been minimized.
q2dg
commented
Oct 12, 2014
|
If you don't plan to rewrite "event-stream" in streams2 (oooh, what a pity!!), do you know another equivalent module that does similar things than yours? |
This comment has been minimized.
This comment has been minimized.
|
no I don't. there are probably already stream2 modules for most of the functions and you'd just need to bundle them together into event-stream2 if you see a job that needs doing, then it's your job |
Raynos commentedSep 8, 2012
Node 0.9 will use the new readable-stream interface.
"data"events,pauseandresumewill be deprecated.We need some kind of upgrade strategy for all these streaming modules. Including scuttlebutt, mux-demux, shoe, etc.