README.md in hwacha-0.1.0 vs README.md in hwacha-0.2.0

- old
+ new

@@ -1,10 +1,10 @@ -# hwacha +# Hwacha [![Build Status](https://travis-ci.org/sdball/hwacha.png?branch=master)](https://travis-ci.org/sdball/hwacha) Hwacha! Harness the power of Typhoeus to quickly check webpage responses. -## Example +## Examples Check a single page. ```ruby hwacha = Hwacha.new @@ -15,18 +15,25 @@ puts "Aww, something that isn't success happened." end end ``` -Check a bunch of pages! Hwacha! +Configure the maximum number of concurrent requests. ```ruby -# 20 is also the default -maximum_number_of_requests_to_work_on_in_parallel = 20 +hwacha = Hwacha.new do |config| + config.max_concurrent_requests = 10 # 20 is the default +end -hwacha = Hwacha.new(maximum_number_of_requests_to_work_on_in_parallel) +# a legacy integer argument is also supported +hwacha = Hwacha.new(10) +``` +Check a bunch of pages! Hwacha! + +```ruby +hwacha = Hwacha.new hwacha.check(array_of_webpage_urls) do |url, response| # each url is enqueued in parallel using the powerful Typhoeus library! # this block is yielded the url and response object for every response! end ``` @@ -52,10 +59,10 @@ want to fire a bunch of requests and find pages that successfully respond. Ok! ```ruby hwacha = Hwacha.new -Hwacha.find_existing(array_of_webpage_urls) do |url| +hwacha.find_existing(array_of_webpage_urls) do |url| # this block will be called for all urls that successfully respond! # hwacha! end ```