Permalink
Browse files

sugar for response_receiver

  • Loading branch information...
Philip (flip) Kromer
Philip (flip) Kromer committed May 5, 2011
1 parent d14ea0e commit 606a1a0328af93db99ca0be7ef62fb1aa563940a
Showing with 1 addition and 5 deletions.
  1. +1 −5 examples/rasterize/rasterize_and_shorten.rb
@@ -14,16 +14,12 @@
class ShortenURL < Goliath::Synchrony::MultiReceiver
SHORTENER_URL_BASE = 'http://is.gd/create.php'
- def enqueue_shortener_req
+ def pre_process
target_url = PostRank::URI.clean(env.params['url'])
shortener_request = EM::HttpRequest.new(SHORTENER_URL_BASE).aget(:query => { :format => 'simple', :url => target_url })
enqueue :shortener, shortener_request
end
- def pre_process
- enqueue_shortener_req
- end
-
def post_process
if successes[:shortener]
headers['X-Shortened-URI'] = successes[:shortener].response

0 comments on commit 606a1a0

Please sign in to comment.