bwbaugh / infertweet

Infer information from Tweets. Useful for human-centered computing tasks, such as sentiment analysis, location prediction, authorship profiling and more!
http://infertweet.bwbaugh.com/
Other
10 stars 1 forks source link

Log web requests asynchronously #31

Closed bwbaugh closed 11 years ago

bwbaugh commented 11 years ago

Instead of spending time logging during the request (blocking the main IO loop), add the log message to a multiprocessing queue to be taken care of by another process.

The back-end for the queue can either be a flat-file like it is currently, but that can be changed in the future to use a database relatively easily.

Be sure to handle the web server shutting down so that the log-writer process can be joined to while it finished logging messages from the queue.