Last Updated: February 25, 2016
·
3.596K
· robmckinnon

avoiding "can't yield from root fiber" error

When using em-synchrony, to avoid unexpected "can't yield from root fiber" error, wrap the block in a new fiber:

Fiber.new {
  some_code
}.resume