UV-Rays was designed to eliminate the complexities of high-performance threaded network programming, allowing engineers to concentrate on their application logic.
- TCP (and UDP) Connection abstractions
- Advanced stream tokenization
- Scheduled events (in, at, every, cron)
- HTTP 1.1 compatible client support
This adds to the features already available from Libuv on which the gem is based
UV-Rays supports all platforms where ruby is available. Linux, OSX, BSD and Windows. MRI, jRuby and Rubinius.
Run gem install uv-rays to install
Here's a fully-functional echo server written with UV-Rays:
require'uv-rays'moduleEchoServerdefon_connect(socket)@ip,@port=socket.peernamelogger.info"-- #{@ip}:#{@port} connected"enddefon_read(data,socket)write">>>you sent: #{data}"close_connectionifdata =~ /quit/ienddefon_closeputs"-- #{@ip}:#{@port} disconnected"endendreactor{UV.start_server"127.0.0.1",8081,EchoServer}UV-Rays works with many existing GEMs by integrating into common HTTP abstraction libraries