sc3 / cookcountyjail

A Django app that tracks the population of Cook County Jail over time and summarizes trends.
http://cookcountyjail.recoveredfactory.net/api/1.0/?format=json
Other
31 stars 23 forks source link

In the Scraper change Inmates calls that fetch data from the DB to use callbacks #283

Open nwinklareth opened 10 years ago

nwinklareth commented 10 years ago

Currently the values fetched from the database by the class Inmates are returned to the caller via a passed in queue mechanism. This exposes the implementation mechanism too much. A cleaner and more future friendly approach would be to use a callback mechanism. The caller would pass in the callback instead of the queue. The callee once the processing is completed would invoke this function with the return value. It is the responsibility of the callback function to make sure that the return value is sent to the calling object for processing.