0 # 1 # ... # 99 get '/hundred' do 100.times.each do |i| chunk(i) end "Starting..." end enqueue content to stream stream response bodies Monday, June 4, 12
get do after_open do # subscribe after_open b/c this runs # until the connection is closed redis.subscribe 'messages' do |on| on.message do |channel, msg| chunk msg end end end # snip... end post do redis.publish 'messages', params[:text] end end end Monday, June 4, 12
get do after_open do # subscribe after_open b/c this runs # until the connection is closed redis.subscribe 'messages' do |on| on.message do |channel, msg| chunk msg end end end # snip... end post do redis.publish 'messages', params[:text] end end end Define a resource Monday, June 4, 12
get do after_open do # subscribe after_open b/c this runs # until the connection is closed redis.subscribe 'messages' do |on| on.message do |channel, msg| chunk msg end end end # snip... end post do redis.publish 'messages', params[:text] end end end Define a resource create messages Monday, June 4, 12
get do after_open do # subscribe after_open b/c this runs # until the connection is closed redis.subscribe 'messages' do |on| on.message do |channel, msg| chunk msg end end end # snip... end post do redis.publish 'messages', params[:text] end end end Define a resource create messages stream new messages Monday, June 4, 12