Sha256: c4a90b87d708bdc90f9d8e557198e7949b5770467c6ffc17d4378a8208be3e3e

Contents?: true

Size: 756 Bytes

Versions: 12

Compression:

Stored size: 756 Bytes

Contents

io = Sinatra::RocketIO
linda = Sinatra::RocketIO::Linda

io.on :connect do |client|
  puts "new client connect <#{client}>"
end

io.on :disconnect do |client|
  puts "bye <#{client}>"
end

linda.on :error do |err|
  STDERR.puts err
end

get '/' do
  haml :index
end

get '/worker' do
  haml :worker
end

get '/client' do
  haml :client
end

linda.on :write do |tuple, client|
  puts "write #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
end

linda.on :read do |tuple, client|
  puts "read #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
end

linda.on :take do |tuple, client|
  puts "take #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
end

linda.on :watch do |tuple, client|
  puts "watch #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sinatra-rocketio-linda-1.0.1 sample/main.rb
sinatra-rocketio-linda-1.0.0 sample/main.rb
sinatra-rocketio-linda-0.2.0 sample/main.rb
sinatra-rocketio-linda-0.1.4 sample/main.rb
sinatra-rocketio-linda-0.1.3 sample/main.rb
sinatra-rocketio-linda-0.1.2 sample/main.rb
sinatra-rocketio-linda-0.1.1 sample/main.rb
sinatra-rocketio-linda-0.1.0 sample/main.rb
sinatra-rocketio-linda-0.0.9 sample/main.rb
sinatra-rocketio-linda-0.0.8 sample/main.rb
sinatra-rocketio-linda-0.0.7 sample/main.rb
sinatra-rocketio-linda-0.0.6 sample/main.rb