Sha256: 65bc2bb59c9da19aa1279d9b49f1fee338a9adf15061b07de5e5ecc89c2539d3
Contents?: true
Size: 659 Bytes
Versions: 18
Compression:
Stored size: 659 Bytes
Contents
Shindo.tests('Excon thread safety') do with_rackup('thread_safety.ru') do connection = Excon.new('http://127.0.0.1:9292') long_thread = Thread.new { response = connection.request(:method => 'GET', :path => '/id/1/wait/2') Thread.current[:success] = response.body == '1' } short_thread = Thread.new { response = connection.request(:method => 'GET', :path => '/id/2/wait/1') Thread.current[:success] = response.body == '2' } test('long_thread') do long_thread.join short_thread.join long_thread[:success] end test('short_thread') do short_thread[:success] end end end
Version data entries
18 entries across 18 versions & 1 rubygems