Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val rateQuote = future {
- connection.getCurrentValue(USD)
- }
- val purchase = rateQuote map { quote =>
- if (isProfitable(quote)) connection.buy(amount, quote)
- else throw new Exception("not profitable")
- }
- purchase onSuccess {
- case _ => println("Purchased " + amount + " USD")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement