Created
May 20, 2011 13:42
-
-
Save JonRowe/982909 to your computer and use it in GitHub Desktop.
Proof of concept for fix for double fiber resume error with em-synchrony and webmock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "em-synchrony" | |
require "em-synchrony/em-http" | |
require 'webmock' | |
include WebMock::API | |
stub_request(:get, "http://www.gooogle.com/").to_timeout | |
EM.synchrony do | |
# pass a callback enabled client to sync to automatically resume it when callback fires | |
# causes a double fiber resume without patch | |
result = EM::Synchrony.sync EventMachine::HttpRequest.new('http://www.gooogle.com/').aget | |
p result | |
EM.stop | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment