Skip to content

Commit

Permalink
Merge pull request #5630 from jroper/fix-ws-client-docs
Browse files Browse the repository at this point in the history
Fixed the scaladocs for WSClient
  • Loading branch information
gmethvin committed Feb 12, 2016
2 parents 27974ef + cf09eb1 commit aafd09e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions framework/src/play-ws/src/main/scala/play/api/libs/ws/WS.scala
Expand Up @@ -69,10 +69,20 @@ trait WSRequestMagnet {
* {{{
* import play.api.libs.ws._
* import play.api.libs.ws.ahc._
* import akka.stream.Materializer
* import play.api.ApplicationLifecycle
* import javax.inject.Inject
* import scala.concurrent.Future
*
* val client = new AhcWSClient(new AhcConfigBuilder())
* client.url("http://example.com/feed").get()
* client.close() // must explicitly manage lifecycle
* class MyService @Inject() (lifecycle: ApplicationLifecycle)(implicit mat: Materializer) {
* private val client = new AhcWSClient(new AhcConfigBuilder().build())
* client.url("http://example.com/feed").get()
* lifecycle.addStopHook(() =>
* // Make sure you close the client after use, otherwise you'll leak threads and connections
* client.close()
* Future.successful(())
* }
* }
* }}}
*
* Or call the client directly:
Expand Down

0 comments on commit aafd09e

Please sign in to comment.