guardian / status-app

Guardian AWS Applications Status App
Apache License 2.0
33 stars 2 forks source link

Make all calls asynchronous and non-blocking #5

Closed philwills closed 11 years ago

philwills commented 11 years ago

Previously, there was a mix of blocking calls to the AWS APIs and asynchronous HTTP requests that were awaited. This changes everything to be asynchronous and non-blocking.

I've adopted a convention of using for comprehensions for dealing with Futures and map/flatMap for dealing with collections. This worked for me in helping me keep which I was dealing with straight in my mind, but I'd love feedback as to how others find this.

rrees commented 11 years ago

I found the futures pretty easy to understand and I liked the use of the agent.

philwills commented 11 years ago

Yes, I should probably make it all agent based, so the number of calls to Amazon isn't proportional to the number of users. One of the disadvantages of making it all nicely asynchronous is that it's really easy to make so many requests a second that you hit the AWS rate limit.