From 056a6dbdd34a451652226ea2a67aa48fc33b159a Mon Sep 17 00:00:00 2001 From: havelkahonza Date: Wed, 16 Oct 2019 20:37:15 +0200 Subject: [PATCH] Renaming Http4sBlazeClient to Http4sBlazeClientModule (#39) * Renaming Http4sBlazeClient to Http4sBlazeClientModule * docs: Regenerate mdoc --- docs/http4s.md | 2 +- docs/index.md | 2 +- docs/jvm.md | 6 +++--- docs/micrometer.md | 10 +++++----- example/src/main/mdoc/http4s.md | 2 +- example/src/main/mdoc/index.md | 2 +- ...BlazeClient.scala => Http4sBlazeClientModule.scala} | 2 +- .../sst/http4s/client/Http4SBlazeClientTest.scala | 2 +- .../http4s/server/Http4sBlazeServerModuleTest.scala | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) rename http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/{Http4sBlazeClient.scala => Http4sBlazeClientModule.scala} (98%) diff --git a/docs/http4s.md b/docs/http4s.md index 24dfa0757..29b196f1a 100644 --- a/docs/http4s.md +++ b/docs/http4s.md @@ -37,7 +37,7 @@ val resource = for { executorModule <- ExecutorModule.makeDefault[Task] console = ConsoleModule.make[Task] server <- Http4sBlazeServerModule.make[Task](Http4sBlazeServerConfig("127.0.0.1", 0), routes, executorModule.executionContext) - client <- Http4sBlazeClient.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) + client <- Http4sBlazeClientModule.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) } yield (server, client, console) val program = resource diff --git a/docs/index.md b/docs/index.md index ed08dc1cd..ad5074f43 100644 --- a/docs/index.md +++ b/docs/index.md @@ -49,7 +49,7 @@ val resource = for { executorModule <- ExecutorModule.makeDefault[Task] console = ConsoleModule.make[Task] server <- Http4sBlazeServerModule.make[Task](Http4sBlazeServerConfig("127.0.0.1", 0), routes, executorModule.executionContext) - client <- Http4sBlazeClient.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) + client <- Http4sBlazeClientModule.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) } yield (server, client, console) val program = resource diff --git a/docs/jvm.md b/docs/jvm.md index 420519a7b..10f69c15f 100644 --- a/docs/jvm.md +++ b/docs/jvm.md @@ -24,11 +24,11 @@ val program = for { console = ConsoleModule.make[Task] _ <- console.printLine(s"Random number: $randomNumber") } yield () -// program: zio.ZIO[Any, Throwable, Unit] = zio.ZIO$FlatMap@159314ca +// program: zio.ZIO[Any, Throwable, Unit] = zio.ZIO$FlatMap@5e8684a3 val runtime = new DefaultRuntime {} // this is just needed in example -// runtime: AnyRef with DefaultRuntime = repl.Session$App$$anon$1@bafc754 // this is just needed in example +// runtime: AnyRef with DefaultRuntime = repl.Session$App$$anon$1@590ab84 // this is just needed in example runtime.unsafeRun(program) -// Random number: 235841973 +// Random number: -1698562956 ``` diff --git a/docs/micrometer.md b/docs/micrometer.md index eec7ee791..450ec919a 100644 --- a/docs/micrometer.md +++ b/docs/micrometer.md @@ -24,10 +24,10 @@ import zio.interop.catz.implicits._ import zio.Task implicit val runtime = new DefaultRuntime {} // this is just needed in example -// runtime: AnyRef with DefaultRuntime = repl.Session$App$$anon$1@1c5cd2ea // this is just needed in example +// runtime: AnyRef with DefaultRuntime = repl.Session$App$$anon$1@cda144a // this is just needed in example val dsl = Http4sDsl[Task] // this is just needed in example -// dsl: Http4sDsl[Task] = org.http4s.dsl.Http4sDsl$$anon$1@1f7fcec2 // this is just needed in example +// dsl: Http4sDsl[Task] = org.http4s.dsl.Http4sDsl$$anon$1@7a71ebf1 // this is just needed in example import dsl._ for { @@ -48,10 +48,10 @@ for { // res0: Resource[Task, Server[Task]] = Bind( // Bind( // Bind( -// Suspend(zio.ZIO$FlatMap@77e1dacd), -// com.avast.sst.jvm.execution.ExecutorModule$$$Lambda$1652/2118457232@34ede267 +// Suspend(zio.ZIO$FlatMap@1c5d376c), +// com.avast.sst.jvm.execution.ExecutorModule$$$Lambda$1652/1064414847@51c6e775 // ), -// cats.effect.Resource$$Lambda$1653/622274963@7a522157 +// cats.effect.Resource$$Lambda$1653/1530060977@5feff876 // ), // // ) diff --git a/example/src/main/mdoc/http4s.md b/example/src/main/mdoc/http4s.md index 196f2c7bf..b3c454a8f 100644 --- a/example/src/main/mdoc/http4s.md +++ b/example/src/main/mdoc/http4s.md @@ -37,7 +37,7 @@ val resource = for { executorModule <- ExecutorModule.makeDefault[Task] console = ConsoleModule.make[Task] server <- Http4sBlazeServerModule.make[Task](Http4sBlazeServerConfig("127.0.0.1", 0), routes, executorModule.executionContext) - client <- Http4sBlazeClient.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) + client <- Http4sBlazeClientModule.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) } yield (server, client, console) val program = resource diff --git a/example/src/main/mdoc/index.md b/example/src/main/mdoc/index.md index 73b8a3b33..b53e544d7 100644 --- a/example/src/main/mdoc/index.md +++ b/example/src/main/mdoc/index.md @@ -49,7 +49,7 @@ val resource = for { executorModule <- ExecutorModule.makeDefault[Task] console = ConsoleModule.make[Task] server <- Http4sBlazeServerModule.make[Task](Http4sBlazeServerConfig("127.0.0.1", 0), routes, executorModule.executionContext) - client <- Http4sBlazeClient.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) + client <- Http4sBlazeClientModule.make[Task](Http4sBlazeClientConfig(), executorModule.executionContext) } yield (server, client, console) val program = resource diff --git a/http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClient.scala b/http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClientModule.scala similarity index 98% rename from http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClient.scala rename to http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClientModule.scala index 4de5fd9ed..aad4e2fda 100644 --- a/http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClient.scala +++ b/http4s-client-blaze/src/main/scala/com/avast/sst/http4s/client/Http4sBlazeClientModule.scala @@ -11,7 +11,7 @@ import org.http4s.client.blaze.BlazeClientBuilder import scala.concurrent.ExecutionContext import scala.language.higherKinds -object Http4sBlazeClient { +object Http4sBlazeClientModule { /** Makes [[org.http4s.client.Client]] (Blaze) initialized with the given config. * diff --git a/http4s-client-blaze/src/test/scala/com/avast/sst/http4s/client/Http4SBlazeClientTest.scala b/http4s-client-blaze/src/test/scala/com/avast/sst/http4s/client/Http4SBlazeClientTest.scala index f38b31aed..9c87c7b3b 100644 --- a/http4s-client-blaze/src/test/scala/com/avast/sst/http4s/client/Http4SBlazeClientTest.scala +++ b/http4s-client-blaze/src/test/scala/com/avast/sst/http4s/client/Http4SBlazeClientTest.scala @@ -17,7 +17,7 @@ class Http4SBlazeClientTest extends AsyncFunSuite { |""".stripMargin val test = for { - client <- Http4sBlazeClient.make[IO]( + client <- Http4sBlazeClientModule.make[IO]( Http4sBlazeClientConfig( userAgent = `User-Agent`(AgentProduct("http4s-client", Some("1.2.3")), List(AgentComment("Test"))) ), diff --git a/http4s-server-blaze/src/test/scala/com/avast/sst/http4s/server/Http4sBlazeServerModuleTest.scala b/http4s-server-blaze/src/test/scala/com/avast/sst/http4s/server/Http4sBlazeServerModuleTest.scala index 3f6a5b0d5..886afbf8f 100644 --- a/http4s-server-blaze/src/test/scala/com/avast/sst/http4s/server/Http4sBlazeServerModuleTest.scala +++ b/http4s-server-blaze/src/test/scala/com/avast/sst/http4s/server/Http4sBlazeServerModuleTest.scala @@ -1,7 +1,7 @@ package com.avast.sst.http4s.server import cats.effect.{ContextShift, IO, Timer} -import com.avast.sst.http4s.client.{Http4sBlazeClient, Http4sBlazeClientConfig} +import com.avast.sst.http4s.client.{Http4sBlazeClientConfig, Http4sBlazeClientModule} import org.http4s.HttpRoutes import org.http4s.dsl.Http4sDsl import org.scalatest.AsyncFunSuite @@ -19,7 +19,7 @@ class Http4sBlazeServerModuleTest extends AsyncFunSuite with Http4sDsl[IO] { }) val test = for { server <- Http4sBlazeServerModule.make[IO](Http4sBlazeServerConfig("127.0.0.1", 0), routes, ExecutionContext.global) - client <- Http4sBlazeClient.make[IO](Http4sBlazeClientConfig(), ExecutionContext.global) + client <- Http4sBlazeClientModule.make[IO](Http4sBlazeClientConfig(), ExecutionContext.global) } yield (server, client) test