radanalyticsio / jiminy-predictor

a predictor service for a spark based recommendation app
Apache License 2.0
2 stars 4 forks source link

adding predictions loop and endpoints #2

Closed elmiko closed 7 years ago

elmiko commented 7 years ago

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