Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Concurrent batching support for client #6
Please do not merge this until I give an OK. I did this on the plane and haven't got gotten a chance to test it with the live API yet.
The client can now be batched to run multiple requests concurrently. If you have to make a lot of API calls (for example, to get balances for a lot of users simultaneously), this will improve performance significantly. Under the hood, it uses internal threading to take advantage of Ruby's non-blocking IO model (one IO request per thread):
buy_price, sell_price = coinbase.batch do |client| client.buy_price 1 client.sell_price 1 end buy_price.inspect # => #<Money fractional:1384 currency:USD>
yup, like we discussed at the conference, i pushed it to https://github.com/coinbase/coinbase-ruby/branches