Clone this wiki locally
Please see Rhinode II
The aim of this project is not to be a 100% node.js compatible implementation on Rhino (although it might go that way). There are other projects that attempt to do this (one is "rhinode" hosted on github as well).
The implementation is pretty straightforward.
- Buffer management is based on NIO buffers.
- Readbuffers are retrieved from a "pool of bytes" which are never reused (that way a buffer can be passed on and held by a caller). The byte pool is allocated in small 64k chunks.
- Writebuffers are implemented as "ByteBufferOutputstream" (similar to ByteArrayOutputstream, but backed by ByteBuffers).
- The HTTP module supports 1.1 and 1.0 clients and servers.
- The FS module currently only "simulates" Readable/Writable streams. (NIO does not have selectable FileChannels, so file streams are always considered readable and writable.)
- It was fun to investigate Java's NIO details, especially w.r.t. to efficient buffer management.
- Java can be directly scripted via Rhino giving access to the full Java class library without extra code.
- Scales nicely to very many clients (resources held per client are basically just the writebuffer and the current http parse state).
- Based on the JVM (some people may consider it a disadvantage, though), so this integrates nicely with other Java libraries.
- The code might be useful to somebody (maybe just to look at how the NIO stuff works).
More performance testing. Apache Bench is very limited.
Implement some real-life examples. (The canonical application seems to be a chat server :) )
Full FileSystem API
- Currently one can use the Java API via Rhino. But that is awkward.
- Only read and write streams are implemented in order to allow files to be served and read to and from network sockets.
Clean up the code
- Some code is pretty adhoc at the moment.
- Use Rhino built-in modules framework. The current version works, but it is pretty cobbled together (see comments in Global.java).
Better name? Currently it's a combination of Rhino and Node (not very clever...)
- I also found that there are other projects named "RhiNode" or "rhinode" already (one is actually on github as well: http://github.com/noonat/rhinode)
Join forces with http://github.com/noonat/rhinode?