{"issue":{"created_at":"2011-10-19T15:38:57Z","state":"closed","updated_at":"2011-11-21T14:37:45Z","user":{"gravatar_id":"b541e45c86f3b6213b6e87af0f537401","id":15787,"url":"https://api.github.com/users/seamusabshere","login":"seamusabshere","avatar_url":"https://secure.gravatar.com/avatar/b541e45c86f3b6213b6e87af0f537401?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":12,"body":"When I run this in Goliath, I always get a <code>double resume</code>\r\n\r\n    [8096:ERROR] 2011-10-19 10:18:57 :: double resume\r\n    ~/my_app/lib/reports.rb:31:in `resume'\r\n    ~/my_app/lib/reports.rb:31:in `block in async_report'\r\n    ~/.rvm/gems/ruby-1.9.2-p290-patched/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:48:in `call'\r\n    ~/.rvm/gems/ruby-1.9.2-p290-patched/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:48:in `callback'\r\n    ~/my_app/lib/reports.rb:27:in `async_report'\r\n\r\nThat's from this code\r\n\r\n    require 'eventmachine'\r\n\r\n    class Reports\r\n      def initialize(app)\r\n        @app = app\r\n      end\r\n\r\n      def call(env)\r\n        env['my.reports'] = async_report\r\n        @app.call env\r\n      end\r\n  \r\n      private\r\n  \r\n      def async_report\r\n        f = ::Fiber.current\r\n    \r\n        reporter = Reporter.new\r\n        reporter.callback do |reports|\r\n          f.resume reports\r\n        end\r\n    \r\n        return ::Fiber.yield\r\n      end\r\n  \r\n      class Reporter\r\n        include ::EventMachine::Deferrable\r\n    \r\n        def initialize\r\n          self.succeed ['hello', 'world']\r\n        end\r\n      end\r\n    end\r\n\r\nI think the problem may be here, but I don't understand how:\r\n\r\n    # lib/goliath/request.rb\r\n    def post_process(results)\r\n      begin\r\n        status, headers, body = results\r\n        return if status && status == Goliath::Connection::AsyncResponse.first\r\n\r\n        callback do\r\n\r\nThanks!\r\n","assignee":null,"id":1995156,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":97,"title":"\"double render\" using EM::Deferrable","closed_at":"2011-11-21T14:37:45Z","html_url":"https://github.com/postrank-labs/goliath/issues/97","url":"https://api.github.com/repos/postrank-labs/goliath/issues/97","milestone":null},"action":"created","comment":{"created_at":"2011-11-21T14:37:45Z","updated_at":"2011-11-21T14:37:45Z","user":{"gravatar_id":"b541e45c86f3b6213b6e87af0f537401","id":15787,"url":"https://api.github.com/users/seamusabshere","login":"seamusabshere","avatar_url":"https://secure.gravatar.com/avatar/b541e45c86f3b6213b6e87af0f537401?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Ilya, thanks for your help on this - closing.","id":2815812,"url":"https://api.github.com/repos/postrank-labs/goliath/issues/comments/2815812"}}