the-algorithm/pushservice/src/main/scala/com/twitter/frigate/pushservice/store/ExploreRankerStore.scala
twitter-team b389c3d302 Open-sourcing pushservice
Pushservice is the main recommendation service we use to surface recommendations to our users via notifications. It fetches candidates from various sources, ranks them in order of relevance, and applies filters to determine the best one to send.
2023-05-19 16:27:07 -05:00

29 lines
890 B
Scala

package com.twitter.frigate.pushservice.store
import com.twitter.explore_ranker.thriftscala.ExploreRanker
import com.twitter.explore_ranker.thriftscala.ExploreRankerResponse
import com.twitter.explore_ranker.thriftscala.ExploreRankerRequest
import com.twitter.storehaus.ReadableStore
import com.twitter.util.Future
/** A Store for Video Tweet Recommendations from Explore
*
* @param exploreRankerService
*/
case class ExploreRankerStore(exploreRankerService: ExploreRanker.MethodPerEndpoint)
extends ReadableStore[ExploreRankerRequest, ExploreRankerResponse] {
/** Method to get video recommendations
*
* @param request explore ranker request object
* @return
*/
override def get(
request: ExploreRankerRequest
): Future[Option[ExploreRankerResponse]] = {
exploreRankerService.getRankedResults(request).map { response =>
Some(response)
}
}
}