mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-18 17:18:48 +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.
37 lines
1.1 KiB
Scala
37 lines
1.1 KiB
Scala
package com.twitter.product_mixer.component_library.module
|
|
|
|
import com.google.inject.Provides
|
|
import com.twitter.conversions.DurationOps._
|
|
import com.twitter.finagle.thriftmux.MethodBuilder
|
|
import com.twitter.finatra.mtls.thriftmux.modules.MtlsClient
|
|
import com.twitter.inject.Injector
|
|
import com.twitter.inject.thrift.modules.ThriftMethodBuilderClientModule
|
|
import com.twitter.socialgraph.thriftscala.SocialGraphService
|
|
import com.twitter.stitch.socialgraph.SocialGraph
|
|
import javax.inject.Singleton
|
|
|
|
object SocialGraphServiceModule
|
|
extends ThriftMethodBuilderClientModule[
|
|
SocialGraphService.ServicePerEndpoint,
|
|
SocialGraphService.MethodPerEndpoint
|
|
]
|
|
with MtlsClient {
|
|
|
|
val label: String = "socialgraphservice"
|
|
val dest: String = "/s/socialgraph/socialgraph"
|
|
|
|
@Singleton
|
|
@Provides
|
|
def provideGizmoduckStitchClient(
|
|
socialGraphService: SocialGraphService.MethodPerEndpoint
|
|
): SocialGraph =
|
|
new SocialGraph(socialGraphService)
|
|
|
|
override protected def configureMethodBuilder(
|
|
injector: Injector,
|
|
methodBuilder: MethodBuilder
|
|
): MethodBuilder = {
|
|
methodBuilder.withTimeoutPerRequest(400.millis)
|
|
}
|
|
}
|