Skip to content

Instantly share code, notes, and snippets.

@gregorymostizky
Created December 28, 2010 18:27
Show Gist options
  • Save gregorymostizky/757513 to your computer and use it in GitHub Desktop.
Save gregorymostizky/757513 to your computer and use it in GitHub Desktop.
Patches async sinatra to use Fiber.new{}.resume for every request
#encoding: utf-8
# Patches async sinatra to use Fiber.new{}.resume for every request
require "sinatra/async"
require "fiber"
module Sinatra
module Async
module Helpers
module_eval %[
alias :__async_catch_execute :async_catch_execute
def async_catch_execute(&b)
Fiber.new{ __async_catch_execute(&b) }.resume
end
]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment