Sha256: 9ceeae8023bbc27722d367c744683d93ecd2bd9b91867c445bdd3d120cfdd2f4

Contents?: true

Size: 391 Bytes

Versions: 12

Compression:

Stored size: 391 Bytes

Contents

#!/usr/bin/env ruby

$:.unshift File.dirname(__FILE__)+"/../../lib/"
require 'magent'

id = "#{rand(16)}#{rand(16)}#{rand(16)}#{rand(16)}"

values = (1..5).to_a.map { rand(10) }
puts values.join(" + ")
Magent.push("workers", :sum, id, *values)

channel = Magent::GenericChannel.new("+#{id}")

loop do
  v = channel.dequeue;
  if v
    $stdout.puts v.inspect
    break
  end
  sleep 0.1
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
magent-0.6.2 examples/comm/run.rb
magent-0.6.1 examples/comm/run.rb
magent-0.6.0 examples/comm/run.rb
magent-0.5.4 examples/comm/run.rb
magent-0.5.3 examples/comm/run.rb
magent-0.5.2 examples/comm/run.rb
magent-0.5.1 examples/comm/run.rb
magent-0.5.0 examples/comm/run.rb
magent-0.4.2 examples/comm/run.rb
thirtysixthspan-magent-0.4.1 examples/comm/run.rb
magent-0.4 examples/comm/run.rb
magent-0.3 examples/comm/run.rb