Sha256: 43c0c18bf48d537d249ac244a04435b55672a20d251682ea3a77bad2e9d93267

Contents?: true

Size: 263 Bytes

Versions: 5

Compression:

Stored size: 263 Bytes

Contents

project_lib_path = File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
$LOAD_PATH.unshift(project_lib_path)
require 'agent'

c = channel!(Integer)

go!(c) do |c|
  i = 0
  loop { c << i+= 1 }
end

p c.receive[0] # => 1
p c.receive[0] # => 2

c.close

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
agent-0.12.0 examples/producer-consumer.rb
agent-0.11.0 examples/producer-consumer.rb
agent-0.10.0 examples/producer-consumer.rb
agent-0.9.1 examples/producer-consumer.rb
agent-0.9.0 examples/producer-consumer.rb