nikhilm / node-taglib

Simple taglib bindings to Javascript using node.js
http://nikhilm.github.com/node-taglib
MIT License
147 stars 25 forks source link

Custom resolver system outside of taglib #28

Open nikhilm opened 12 years ago

nikhilm commented 12 years ago

The current mutex based system works, but it has one significant taglib level shortcoming that FileTypeResolver takes only filenames and not IOStream.

In addition, the requirement that no v8 activity occurs in a worker thread requires hacks like the mutex one currently in place. This is obviously not fun, and at some point I want to allow resolvers themselves to notify the format via a callback. Finally reading and writing from buffers using BufferStream means that JS resolvers should be able to get a buffer as an argument.

So we need our own system, that will trigger the callbacks sequentially whenever a read is attempted, then use the format string to create the right File wrapping the BufferStream.