Created
October 16, 2013 11:37
-
-
Save prdetective/7006380 to your computer and use it in GitHub Desktop.
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
class SinatraApp < Sinatra::BASE | |
get '/send' do | |
halt 500, 'Wrong parameters' if params['url'].nil? or params['url'].empty? | |
RequestSender.send(params['url']) | |
'OK' | |
end | |
end | |
class RequestSender | |
def self.send(gained_url) | |
EM.defer do | |
# синхронный код посылки/ответа HTTP-запроса | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment