fooClient { baseUrl = "http://example.com" play.ws.timeout.connection = 2s play.ws.timeout.idle = 20s play.ws.timeout.request = 20s}
def wsClient(wsConfig: Config, applicationLifecycle: ApplicationLifecycle)(implicit mat: Materializer): WSClient = { val client = new AhcWSClient(StandaloneAhcWSClient(config = AhcWSClientConfigFactory.forConfig(wsConfig.withFallback(ConfigFactory.load)))) lifecycle.addStopHook(() => Future.successful(client.close())) client}
Enter def wsClient(wsConfig: Config, applicationLifecycle: ApplicationLifecycle)(implicit mat: Materializer): WSClient = { val client = AhcWSClient(AhcWSClientConfigFactory.forConfig(wsConfig.withFallback(ConfigFactory.load))) lifecycle.addStopHook(() => Future.successful(client.close())) client}
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/af98efdf-ffdb-40b8-938e-f6d84cdfd585%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
private lazy val client = { val configuration = Configuration.reference ++ Configuration(wsConfig) val parser = new WSConfigParser(configuration, env) val config = new AhcWSClientConfig(wsClientConfig = parser.parse()) val builder = new AhcConfigBuilder(config) val client = AhcWSClient(builder.build()) lifecycle.addStopHook { () => Future(client.close()) } client}
def get(wsConfig: Config): WSClient = { val config = AhcWSClientConfigFactory.forConfig(wsConfig.withFallback(ConfigFactory.load)) val client = AhcWSClient(config)
applicationLifecycle.addStopHook(() => Future.successful(client.close())) client}
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/09817464-c9a9-4945-aad9-8ba8b2388411%40googlegroups.com.