This requires that onExit() is not called immediately upon receiving a
SIGCHLD. There could still be data in the pipez. So, instead just set a
flag and invoke the pipe watchers.
Sometimes one will not receive an EOF from pipes because the process was
killed by a SIGTERM, or something. If SIGCHLD has been recved but we are
getting EAGAIN, the pipez need to be closed too.
onExit() is similar to the onLoad() callback. onExit() is called on each
module just before the process exits. This can be used to check state in
unit tests, but not to perform I/O. The process will forcibly exit as soon
as all of the onExit callbacks are made.
There is one major API change in the refactor: filename extensions are now
required when requiring or including modules.
Added extra test to test-module-loading.js.
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 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.
For server-side sockets, no longer pass the server object to the
js constructor. This is set later with SetAcceptor.
I think the change is a bit strage and convoluted but it allows one give
protocol /classes/ to the c++ constructors instead of protocol instances.
This is nice because derived classes (like HTTP) don't need to copy the
protocol instanciation code.
Here I massively change both the external and internal API of the TCP
sockets and servers.
This change introduces the concept of a protocol object like is found in
Twisted Python. I believe this allows for a much cleaner description of how
a socket behaves. What was once a single object "client" or "connection" is
now represented by two objects: a "connection" and a "protocol".
Well - I don't want to ramble too much because neither API is yet public or
documented. Look the diff of test/test-pingpong.js to see how things have
changed.