Sha256: f23035c5e9666486b27c0cda95188824cf7e74868ddef9b7d1b51b81a39c9cec
Contents?: true
Size: 658 Bytes
Versions: 5
Compression:
Stored size: 658 Bytes
Contents
# # Oops, were you expecting some real RSpec? # # I'm sorry to disappoint. Really, this is pretty damn weak. # # I swear that after Ruby 1.9 comes out proper, this will become an actual spec # require 'socket' require File.dirname(__FILE__) + '/../lib/rev' class MyWatcher < Rev::IOWatcher def on_readable puts "Yippie, I'm readable!" detach end end listen_socket = TCPServer.new 'localhost', 4321 watcher = MyWatcher.new(listen_socket) event_loop = Rev::Loop.new watcher.attach(event_loop) puts "Running the event loop in blocking mode on localhost port 4321" puts "Telnet there or something and you should get a read event" event_loop.run
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
rev-0.1.0 | spec/rev_spec.rb |
rev-0.1.1 | spec/rev_spec.rb |
rev-0.1.2 | spec/rev_spec.rb |
rev-0.1.4 | spec/rev_spec.rb |
rev-0.1.3 | spec/rev_spec.rb |