Concurrent batching support for client #6

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
@kyledrake
Contributor

kyledrake commented Apr 17, 2013

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>
@kyledrake

This comment has been minimized.

Show comment
Hide comment
@kyledrake

kyledrake May 21, 2013

Contributor

Can I get some traction on this? I'm cleaning up my Github account and I want to remove my coinbase-ruby fork.

Contributor

kyledrake commented May 21, 2013

Can I get some traction on this? I'm cleaning up my Github account and I want to remove my coinbase-ruby fork.

@lian

This comment has been minimized.

Show comment
Hide comment
@lian

lian May 21, 2013

Contributor

yup, like we discussed at the conference, i pushed it to https://github.com/coinbase/coinbase-ruby/branches

Contributor

lian commented May 21, 2013

yup, like we discussed at the conference, i pushed it to https://github.com/coinbase/coinbase-ruby/branches

@lian lian closed this May 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment