bbc / alephant-broker

Brokers requests for alephant components
MIT License
4 stars 3 forks source link

[Ready] Extract S3 broking strategy #14

Closed darnould closed 10 years ago

darnould commented 10 years ago

Problem

Due to the need to have two methods for getting data for a given component (S3 and HTTP endpoint), we need to first extract out the current S3 logic into a Loading Strategy.

Solution

  1. Extract S3 logic into loading strategy.
  2. Create ComponentFactory.
  3. ComponentFactory uses specified loading strategy to create component with correct content, headers etc.

Note: This PR includes a refactor of rack_spec.rb.

touchdown.gif

revett commented 10 years ago

Still needs a spec for the S3 strategy, however this is going to be done in a separate PR by @darnould - so that I can start on the new HTTP strategy at the same time.

revett commented 10 years ago

@stevenjack @Integralist could you please have a look at these changes? As it's quite a large PR due to the design changes. :surfer:

stevenjack commented 10 years ago

how's this looking chaps? Liking the look of the component meta, seems like a sensible approach to sort out the batch loading :cake:

revett commented 10 years ago

@stevenjack Just tested the Batch requests using .pmap and works as expected. Ready to merge :+1: