sample/main.rb in sinatra-cometio-0.1.5 vs sample/main.rb in sinatra-cometio-0.1.6
- old
+ new
@@ -9,9 +9,10 @@
CometIO.push :chat, {:name => "system", :message => "welcome <#{session}>"}, {:to => session}
end
CometIO.on :disconnect do |session|
puts "disconnect client <#{session}>"
+ CometIO.push :chat, {:name => "system", :message => "bye <#{session}>"}
end
EM::defer do
loop do
CometIO.push :chat, :name => 'clock', :message => Time.now.to_s