Sha256: 5b6b25d9cbc1a041634bba8f9f3e6b22056a88a27afd9a6af3bc773973c8e709
Contents?: true
Size: 655 Bytes
Versions: 10
Compression:
Stored size: 655 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' } long_thread.join short_thread.join test('long_thread') do long_thread[:success] end test('short_thread') do short_thread[:success] end end end
Version data entries
10 entries across 10 versions & 1 rubygems