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.26.0 tests/thread_safety_tests.rb
excon-0.25.3 tests/thread_safety_tests.rb
excon-0.25.2 tests/thread_safety_tests.rb
excon-0.25.1 tests/thread_safety_tests.rb
excon-0.25.0 tests/thread_safety_tests.rb
excon-0.24.0 tests/thread_safety_tests.rb
excon-0.23.0 tests/thread_safety_tests.rb
excon-0.22.1 tests/thread_safety_tests.rb
excon-0.22.0 tests/thread_safety_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/excon-0.20.1/tests/thread_safety_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/excon-0.20.1/tests/thread_safety_tests.rb
excon-0.21.0 tests/thread_safety_tests.rb
excon-0.20.1 tests/thread_safety_tests.rb
excon-0.20.0 tests/thread_safety_tests.rb
excon-0.19.5 tests/thread_safety_tests.rb
excon-0.19.4 tests/thread_safety_tests.rb
excon-0.19.3 tests/thread_safety_tests.rb
excon-0.19.2 tests/thread_safety_tests.rb
excon-0.19.1 tests/thread_safety_tests.rb
excon-0.19.0 tests/thread_safety_tests.rb