Today, in Ruby, if I want to make a network request, I block
response = Net::HTTP.get("/post/1")If I want to do multiple requests in parallel, I can use a thread per request
responses = ["/post/1", "/post/2"].map do |url|| default: &default | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: 5 | |
| username: root | |
| password: | |
| host: localhost | |
| development: | |
| <<: *default |
| --- | |
| - :cod_uf: '52' | |
| :uf: Goiás | |
| :city_id: '00050' | |
| :city: Abadia de Goiás | |
| :sigla_uf: GO | |
| :city_code: '5200050' | |
| - :cod_uf: '31' | |
| :uf: Minas Gerais | |
| :city_id: '00104' |
Today, in Ruby, if I want to make a network request, I block
response = Net::HTTP.get("/post/1")If I want to do multiple requests in parallel, I can use a thread per request
responses = ["/post/1", "/post/2"].map do |url|| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |