Skip to content

Commit

Permalink
Merge pull request #41 from RayRacine/explicit-close
Browse files Browse the repository at this point in the history
Add close() method on the Client.
  • Loading branch information
jeremyrsmith authored Sep 19, 2016
2 parents 4e6490c + b7e4bd7 commit 9d69c39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions featherbed-core/src/main/scala/featherbed/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class Client(
def delete(relativePath: String): DeleteRequest[Coproduct.`"*/*"`.T] =
DeleteRequest[Coproduct.`"*/*"`.T](baseUrl.toURI.resolve(relativePath).toURL, List.empty)

/**
* Close this client releasing allocated resources.
*/
def close (): Unit =
httpClient.close()

protected def clientTransform(client: Http.Client): Http.Client = client

protected val client = clientTransform(Client.forUrl(baseUrl))
Expand Down

0 comments on commit 9d69c39

Please sign in to comment.