Skip to content

Instantly share code, notes, and snippets.

@JonRowe
Created May 20, 2011 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonRowe/982909 to your computer and use it in GitHub Desktop.
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
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