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

Version Path
excon-0.41.0 tests/thread_safety_tests.rb
excon-0.40.0 tests/thread_safety_tests.rb
excon-0.39.6 tests/thread_safety_tests.rb
excon-0.39.5 tests/thread_safety_tests.rb
excon-0.39.4 tests/thread_safety_tests.rb
excon-0.39.3 tests/thread_safety_tests.rb
excon-0.39.2 tests/thread_safety_tests.rb
excon-0.39.1 tests/thread_safety_tests.rb
excon-0.39.0 tests/thread_safety_tests.rb
excon-0.38.0 tests/thread_safety_tests.rb
excon-0.37.0 tests/thread_safety_tests.rb
excon-0.36.0 tests/thread_safety_tests.rb
excon-0.35.0 tests/thread_safety_tests.rb
excon-0.34.0 tests/thread_safety_tests.rb
excon-0.33.0 tests/thread_safety_tests.rb
excon-0.32.1 tests/thread_safety_tests.rb
excon-0.32.0 tests/thread_safety_tests.rb
excon-0.31.0 tests/thread_safety_tests.rb