Skip to content

Instantly share code, notes, and snippets.

@prdetective
Created October 16, 2013 11:37
Show Gist options
  • Save prdetective/7006380 to your computer and use it in GitHub Desktop.
Save prdetective/7006380 to your computer and use it in GitHub Desktop.
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