Skip to content

Commit

Permalink
Update Site
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Aug 4, 2021
1 parent eefda85 commit 94b5bad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions site/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ libraryDependencies ++= Seq(
import cats._
import cats.implicits._
import cats.effect._
import cats.effect.concurrent.Ref
import io.chrisdavenport.mules._
import io.chrisdavenport.mules.caffeine._
import io.chrisdavenport.mules.http4s._
Expand All @@ -32,10 +31,7 @@ import org.http4s.implicits._
import org.http4s.client.Client
import org.http4s.asynchttpclient.client._

implicit val T = IO.timer(scala.concurrent.ExecutionContext.global)
implicit val CS = IO.contextShift(scala.concurrent.ExecutionContext.global)

def testMiddleware[F[_]: Bracket[*[_], Throwable]](c: Client[F], ref: Ref[F, Int]): Client[F] = {
def testMiddleware[F[_]: Concurrent](c: Client[F], ref: Ref[F, Int]): Client[F] = {
Client{req => c.run(req).evalMap(resp => ref.update(_ + 1).as(resp))}
}

Expand All @@ -54,6 +50,8 @@ val exampleCached = AsyncHttpClient.resource[IO]().use{ client =>
} yield (count1, count2)
}

import cats.effect.unsafe.implicits.global // DON'T DO THIS IN PROD

exampleCached.unsafeRunSync()

val dadJokesRequest = Request[IO](Method.GET, uri"https://icanhazdadjoke.com/")
Expand Down

0 comments on commit 94b5bad

Please sign in to comment.