Skip to content

Instantly share code, notes, and snippets.

Last active July 20, 2023 10:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
EmberClientCall.scala (trying to work out why we get a stack trace, seems that this is a known issue)
import cats.effect.{IO, IOApp}
import org.http4s.{Headers, MediaType, Method, Request}
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.headers.Accept
import org.http4s.implicits.http4sLiteralsSyntax
import org.typelevel.log4cats.LoggerFactory
import org.typelevel.log4cats.slf4j.Slf4jFactory
object EmberClientCall extends IOApp.Simple {
private implicit val loggerFactory: LoggerFactory[IO] =
private val clientResource = EmberClientBuilder
val run: IO[Unit] = {
for {
_ <- IO.println("Hello")
ret <- clientResource.use {
client =>
method = Method.GET,
headers = Headers(Accept(MediaType.application.json)),
_ <- IO.println(s"Have run client $ret")
} yield ()
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
at java.base/
at java.base/
at delay @$AsyncSocket.$anonfun$readChunk$2(SocketPlatform.scala:120)
at delay @$AsyncSocket.$anonfun$readChunk$1(SocketPlatform.scala:120)
at async @$AsyncSocket.readChunk(SocketPlatform.scala:114)
at flatMap @$BufferedReads.$anonfun$read$1(SocketPlatform.scala:82)
at delay @$BufferedReads.withReadBuffer(SocketPlatform.scala:52)
at clear @ org.http4s.client.middleware.Retry$.retryLoop$1(Retry.scala:92)
at getAndSet @ org.typelevel.keypool.KeyPool$.destroy(KeyPool.scala:120)
Have run client {"name":"Tatooine","rotation_period":"23","orbital_period":"304","diameter":"10465","climate":"arid","gravity":"1 standard","terrain":"desert","surface_water":"1","population":"200000","residents":["","","","","","","","","",""],"films":["","","","",""],"created":"2014-12-09T13:50:49.641000Z","edited":"2014-12-20T20:58:18.411000Z","url":""}
Process finished with exit code 0
Copy link

Ah, known issue typelevel/fs2#3238 in v3.8.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment