This is a big change that brings in the /predictions endpoint and a
bunch of support stuff for it. The Spark context is stubbed out in the
prediction loop for easy reference later.
The key components of communication are 2 multiprocessing.Queue objects
that can be used to send requests to and response from the prediction
process. There is also a thread which helps synchornize communication
between the 2 processes. Lastly, the cache has threading.Lock's to keep
it safe with the HTTP servicing thread.
Changes
add a second process to do prediction calculations
add a url for /predictions to post new requests
add a url for /predictions/ to get details
add a memory based storage backend for cache
add errors module with helpers and exceptions
add an updater thread to keep cache in sync with prediction process
This is a big change that brings in the /predictions endpoint and a bunch of support stuff for it. The Spark context is stubbed out in the prediction loop for easy reference later.
The key components of communication are 2 multiprocessing.Queue objects that can be used to send requests to and response from the prediction process. There is also a thread which helps synchornize communication between the 2 processes. Lastly, the cache has threading.Lock's to keep it safe with the HTTP servicing thread.
Changes