All the c++ code is now reduced to simple wrappers. The node.fs.File object
is defined entirely in javascript now. As is the actionQueue methods.
This makes the boundaries much cleaner. There is still some thought that
needs to go into how exactly the API should behave but this simplification
is a first step.
The error codes still remain for the two general file system operations:
rename and stat.
Additionally I've removed the actionQueue for file system operations. They
are sent directly into the thread pool.
Instead we're going to just get a single callback for the URI. This can be
parsed additionally in javascript using parseuri:
http://blog.stevenlevithan.com/archives/parseuri
I haven't added that yet, but it will come soon.
Encoding UTF-16 (the native string representation) to UTF-8 is rather
expensive, however just chopping off the second bit to convert UTF-16 to
ASCII is rather fast. I've noticed major performance issues with
String::WriteUtf8 and thus I'm going to explicitly separate in the API.
Still need interfaces to this for the web server.
This is sloppy: after each ObjectWrap allocation the user needs to
call ObjectWrap::InformV8ofAllocation(). In addition each class deriving
from ObjectWrap needs to implement the virtual method size() which should
return the size of the derived class. If I was better at C++ I could
possibly make this less ugly. For now this is how it is.
Memory usage looks much better after this commit.
Instead servers are passed a function which gets called on connection (like
in the original design) which has one argument, the connecting socket. The
user sets up callbacks on that. It's pretty much how I had it originally.
Encoding is now set via v8 getter/setter and can be changed dynamically.
The timeout for all sockets is fixed at 60 seconds for now. Need to fix
that.