mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 06:38:52 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
23 lines
618 B
Scala
23 lines
618 B
Scala
package com.twitter.cr_mixer.filter
|
|
|
|
import com.twitter.cr_mixer.model.CandidateGeneratorQuery
|
|
import com.twitter.cr_mixer.model.InitialCandidate
|
|
import com.twitter.util.Future
|
|
|
|
trait FilterBase {
|
|
def name: String
|
|
|
|
type ConfigType
|
|
|
|
def filter(
|
|
candidates: Seq[Seq[InitialCandidate]],
|
|
config: ConfigType
|
|
): Future[Seq[Seq[InitialCandidate]]]
|
|
|
|
/**
|
|
* Build the config params here. passing in param() into the filter is strongly discouraged
|
|
* because param() can be slow when called many times
|
|
*/
|
|
def requestToConfig[CGQueryType <: CandidateGeneratorQuery](request: CGQueryType): ConfigType
|
|
}
|