https://github.com/cotag/uv-rays
Abstractions for Libuv
https://github.com/cotag/uv-rays
Last synced: about 1 year ago
JSON representation
Abstractions for Libuv
- Host: GitHub
- URL: https://github.com/cotag/uv-rays
- Owner: cotag
- License: mit
- Created: 2013-10-10T01:00:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T07:32:27.000Z (over 2 years ago)
- Last Synced: 2025-03-25T18:13:45.797Z (over 1 year ago)
- Language: Ruby
- Size: 178 KB
- Stars: 12
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uv-rays
[](https://travis-ci.org/cotag/uv-rays)
UV-Rays was designed to eliminate the complexities of high-performance threaded network programming, allowing engineers to concentrate on their application logic.
## Core Features
1. TCP (and UDP) Connection abstractions
2. Advanced stream tokenization
3. Scheduled events (in, at, every, cron)
4. HTTP 1.1 compatible client support
This adds to the features already available from [Libuv](https://github.com/cotag/libuv) on which the gem is based
## Support
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
## Getting Started
Here's a fully-functional echo server written with UV-Rays:
```ruby
require 'uv-rays'
module EchoServer
def on_connect(socket)
@ip, @port = socket.peername
logger.info "-- #{@ip}:#{@port} connected"
end
def on_read(data, socket)
write ">>>you sent: #{data}"
close_connection if data =~ /quit/i
end
def on_close
puts "-- #{@ip}:#{@port} disconnected"
end
end
reactor {
UV.start_server "127.0.0.1", 8081, EchoServer
}
```
# Integrations
UV-Rays works with many existing GEMs by integrating into common HTTP abstraction libraries
* [Faraday](https://github.com/lostisland/faraday)
* [HTTPI](https://github.com/savonrb/httpi)
* [Handsoap](https://github.com/unwire/handsoap)