Run this block in a new thread : Ruby Threads « Threads « Ruby
- Ruby
- Threads
- Ruby Threads
Run this block in a new thread
t = Thread.new do # Run this block in a new thread
File.read("data.txt") # Read a file in the background
end # File contents available as thread value
Related examples in the same category