I have not written any C addons, but I do know that EventEmitter has been removed from the C side of node.
a tight wrapper based on callbacks, and then wrap that with a Stream api on the js side is indeed how node does it. reading through github.com/joyent/node/blob/master/lib/fs.js should be helpful. there is quite a bit to writing a Stream that works well. I am developing a Stream spec here https://gist.github.com/2850882 I'm just building it from studying stream.js, reading code in node.js core streams. cheers, Dominic On Wed, Jun 27, 2012 at 2:40 AM, Dan Søndergaard <dan1...@gmail.com> wrote: > Hi, > > I'm trying to write my first node addon (I have no previous experience with > C++ whatsoever). It's basically a wrapper for the PortAudio library. > > I started out thinking that I would do the whole thing in C++, but now I > realize that it is very difficult to implement the EventListener and Stream > "interfaces" in native code, which tells me that I should just write a very > basic, direct wrapper to the library, and then build up a usable API in > Javascript afterwards. Is this correct? > > Assuming that I'm going to write the exposed API in JS, how would I approach > that? > > If it's possible to write the entire thing in C++, how do I then "inherit" > EventListener and Stream? > > I apologize if the explanation is confusing, I'm still just trying to figure > out the different layers of abstraction in node :-) > > Thanks, > > Dan > > -- > 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