Sha256: fcaae74474005d238c4dc848995412e5f89b7a57ccdcb83dafedbece3a3fad32

Contents?: true

Size: 320 Bytes

Versions: 5

Compression:

Stored size: 320 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

puts "Process pid: #{Process.pid}"

threads = 10.times.collect do
	Thread.new do
		begin
			sleep
		rescue Exception
			puts "Thread: #{$!}"
		end
	end
end

while true
	begin
		threads.each(&:join)
		exit(0)
	rescue Exception
		puts "Join: #{$!}"
	end
end

puts "Done"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
async-container-0.16.5 examples/threads.rb
async-container-0.16.4 examples/threads.rb
async-container-0.16.3 examples/threads.rb
async-container-0.16.2 examples/threads.rb
async-container-0.16.1 examples/threads.rb