Sha256: b6a6843bf99bba6ff151c6679b11f17b15ace039124d2e30accde6d0a18fcdb3

Contents?: true

Size: 655 Bytes

Versions: 84

Compression:

Stored size: 655 Bytes

Contents

with_rackup('thread_safety.ru') do
  Shindo.tests('Excon thread safety') 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

84 entries across 84 versions & 3 rubygems

Version Path
excon-0.18.5 tests/thread_safety_tests.rb
excon-0.18.4 tests/thread_safety_tests.rb
excon-0.18.3 tests/thread_safety_tests.rb
excon-0.18.2 tests/thread_safety_tests.rb
excon-0.18.1 tests/thread_safety_tests.rb
excon-0.18.0 tests/thread_safety_tests.rb
excon-0.17.0 tests/thread_safety_tests.rb
excon-0.16.10 tests/thread_safety_tests.rb
excon-0.16.9 tests/thread_safety_tests.rb
excon-0.16.8 tests/thread_safety_tests.rb
excon-0.16.7 tests/thread_safety_tests.rb
excon-0.16.5 tests/thread_safety_tests.rb
excon-0.16.4 tests/thread_safety_tests.rb
excon-0.16.3 tests/thread_safety_tests.rb
excon-0.16.2 tests/thread_safety_tests.rb
excon-0.16.1 tests/thread_safety_tests.rb
excon-0.16.0 tests/thread_safety_tests.rb
excon-0.15.5 tests/thread_safety_tests.rb
excon-0.15.4 tests/thread_safety_tests.rb
excon-0.15.3 tests/thread_safety_tests.rb