Sha256: 73c60f86ef351241161ea5aa86b5d066388ece114382f2a8020b1c54f7cd74ed

Contents?: true

Size: 571 Bytes

Versions: 121

Compression:

Stored size: 571 Bytes

Contents

require "#{File.dirname(__FILE__)}/../dataflow"
require 'net/http'
include Dataflow

# Be gentle running this one
Thread.abort_on_exception = true
local do |stream, branding_occurences, number_of_mentions|
  unify stream, Array.new(10) { need_later { Net::HTTP.get_response(URI.parse("http://www.cuil.com/search?q=#{rand(1000)}")).body } }
  unify branding_occurences, need_later { stream.map {|http_body| http_body.scan /cuil/ } }
  unify number_of_mentions, need_later { branding_occurences.map {|occurences| occurences.length } }
  puts number_of_mentions.inspect
end

Version data entries

121 entries across 121 versions & 3 rubygems

Version Path
engineyard-serverside-2.0.4 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.5 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.3 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.2 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.1 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.rc1 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.pre5 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.pre4 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.pre3 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.pre2 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-2.0.0.pre1 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.7.0.pre2 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre6 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre5 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre4 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre3 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre2 lib/vendor/dataflow/examples/future_http_gets.rb
engineyard-serverside-1.6.4.pre lib/vendor/dataflow/examples/future_http_gets.rb