lightio icon indicating copy to clipboard operation
lightio copied to clipboard

`fiber called across stack rewinding barrier` error in rails console

Open EdwardDiehl opened this issue 5 years ago • 1 comments

I've added lightio to my Gemfile, started rails console and tried to execute the simple example

Running via Spring preloader in process 10594
Loading development environment (Rails 5.2.2)
irb(main):001:0> result = []
=> []
irb(main):002:0> b1 = LightIO::Beam.new {result << 1}
=> #<LightIO::Core::Beam:0x0000557fd27d0b48@/home/username/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/beam.rb:49 (created)>
irb(main):003:0> b2 = LightIO::Beam.new {result << 2}
=> #<LightIO::Core::Beam:0x0000557fd27f8440@/home/username/.asdf/installs/ruby/2.5.3/lib/ruby/gems/2.5.0/gems/lightio-0.4.4/lib/lightio/core/beam.rb:49 (created)>
irb(main):004:0> b1.join
Traceback (most recent call last):
        1: from (irb):4
FiberError (fiber called across stack rewinding barrier)
irb(main):005:0> 

Do I need to use Soba project with rails in order to execute this code in the rails console?

EdwardDiehl avatar Jan 08 '19 09:01 EdwardDiehl

Hi, sorry for responding such late.

Beam#join must be called inside another beam.

jjyr avatar Feb 20 '19 02:02 jjyr