I'd recommend not doing the "stream" bit in C++, and instead have a much simpler binding layer that does a single action, and then use JavaScript to wrap up the queue of writes and emitted data blobs.
Check out the zlib binding in src/node_zlib.cc and lib/zlib.js in node's source. It does something similar to this. On Sun, Apr 15, 2012 at 20:39, rhasson <rhas...@gmail.com> wrote: > I'm working on a C++ NLP binding and wanted to implemented a streaming > interface so that text could be added to a stream in JS, my native binding > will receive it, extract the text process it and emit a "data"events with > the responses. > > How would I go about reading a stream that was either passed in as an > argument or was piped in via "pipe"? I'm assuming I'll have to implement > the pipe interface as well which I'm not sure how to do yet > > Thanks, > Roy > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en