ruby-concurrency / concurrent-ruby

Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.
https://ruby-concurrency.github.io/concurrent-ruby/
Other
5.71k stars 420 forks source link

Concurrent::Channel - doesn't exist #902

Closed GildedHonour closed 3 years ago

GildedHonour commented 3 years ago

The example taken from here https://github.com/ruby-concurrency/concurrent-ruby/blob/a5076bf9e977b290cce5a65b7b72810562bca295/docs-source/channel.md

irb(main):001:0> require 'concurrent'
=> true

irb(main):002:0> puts "Main thread: #{Thread.current}"
Main thread: #<Thread:0x00005581cd29b428 run>
=> nil

irb(main):004:1* Concurrent::Channel.go do
irb(main):005:1*   puts "Goroutine thread: #{Thread.current}"
irb(main):006:0> end

Traceback (most recent call last):
        4: from /home/alex/.rubies/ruby-3.0.0/bin/irb:23:in `<main>'
        3: from /home/alex/.rubies/ruby-3.0.0/bin/irb:23:in `load'
        2: from /home/alex/.rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
        1: from (irb):3:in `<main>'
NameError (uninitialized constant Concurrent::Channel)
pitr-ch commented 3 years ago

Use require "concurrent-edge" as well.