PredictionIO / template-scala-parallel-universal-recommendation

PredictiionIO Template for Universal Recommender
111 stars 48 forks source link

Request for configurable prediction request timeouts. #5

Open JohnBDonner opened 9 years ago

JohnBDonner commented 9 years ago

I'd like to request that request timeouts on predictions be configurable by the prediction query or the engine.json.

Such as in the getBiasedRecentUserActions method:

...
// set time limit to avoid super long DB access
timeout = Duration(200, "millis")
...
pferrel commented 9 years ago

Good idea

pferrel commented 9 years ago

Might also need to set future for creating indexes in Elasticsearch since they could take a long time to complete before the hot-swap.

tuxdna commented 9 years ago

Where should the code that handles timeout configuration be placed?

I think if the results of LServing.serve(query: Q, predictions: Seq[P]): P have to be wrapped into a Future[P], then the change needs to be made to both the projects.

On a broader scope, many of the calls in the project could have a Future variant which support asynchronous calls.

tuxdna commented 9 years ago

LEventStore has private val defaultTimeout = Duration(60, "seconds") set as default, so first change should go in there ( PredictionIO ).

Why does LEventStore have only blocking calls?