uber/eight-track — pull request #10 by twolfson (2014-01-27 02:50:56+00:00)
Title: Refactor eight-track to use Connection classes for incoming/outgoing requests/responses and fs-store for interacting with storage abstraction

After the initial composition of `eight-track`, I was unhappy with the total line length and length of the functions. This refactor establishes more abstractions (which themselves should be node modules) and cleans up the code to a more tolerable state.

In this PR:

- Create an `IncomingConnection` and `OutgoingConnection` class for different sets of `requests` and `responses`
- Break out `fs` interactions into their own storage system
- I looked for a node module which matched our interaction but could not find one. The system is designed to save each request/response pair under its own `.json` file
- Move all middleware logic into an instance method
- Move request handling from nested callbacks to `async.waterfall`

> This PR contains changes from #8 which means #8 must be merged first.

/cc @mlmorg @Raynos