I have the following code snippet using sinatra/async where it seems the call to second body statement is skipped. All the examples on the web seem to say this should work. How do I send push notification ?
aget '/result' do
body 'Here are the results: <br/>'
@@result.each do |item|
filename = item[:title]+'.out'
File.open(File.join(@@directory, filename), "w") do |f|
f.write(URI.parse(item[:url]).read)
end
body "File #{filename} has been created.<br/>"
end
end
I am running on Thin v1.2.11