Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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
Add Comment
Please, Sign In to add comment