Skip to content

Instantly share code, notes, and snippets.

@irridescentrambler
Created March 8, 2026 08:30
Show Gist options
  • Select an option

  • Save irridescentrambler/a5d92a5a1bdfb2892585d26d4d1a5ada to your computer and use it in GitHub Desktop.

Select an option

Save irridescentrambler/a5d92a5a1bdfb2892585d26d4d1a5ada to your computer and use it in GitHub Desktop.
worker = nil
manager = Fiber.new do |work_for_manager|
puts "Manager starting the work"
puts "Doing the work...(Manager)"
puts work_for_manager
puts "Ending the work..(Manager)"
worker.transfer("Do this now - Manager")
puts "Approving - Manager"
puts "Manager logging off"
worker.transfer
end
worker = Fiber.new do |work_for_employee|
puts "Worker starting the work"
puts "Doing the work..(Worker)"
puts work_for_employee
puts "Ending the work..(Worker)"
manager.transfer("Work is completed. Please approve the PR - Worker")
puts "Worker logging off"
end
manager.resume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment