Skip to content

Instantly share code, notes, and snippets.

@forsaken1
Created October 19, 2022 13:56
Show Gist options
  • Save forsaken1/6a578602ea6f930af81dde87313c8089 to your computer and use it in GitHub Desktop.
Save forsaken1/6a578602ea6f930af81dde87313c8089 to your computer and use it in GitHub Desktop.
Async Ractors
puts 'before Thread'
ractor = Ractor.new do
puts 'Thread start'
sleep Ractor.receive
puts 'Thread end'
end
puts 'after Thread'
ractor.send 5
puts 'after send' # you should see "after send" and "Thread start" immediately
sleep 6
puts 'end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment