All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spice.http.client.package.scala Maven / Gradle / Ivy

There is a newer version: 0.5.15
Show newest version
package spice.http

import cats.effect.IO

import java.util.concurrent.{CompletableFuture, CompletionException}
import scala.jdk.FutureConverters.CompletionStageOps

package object client {
  implicit class CompletableFutureExtras[T](cf: CompletableFuture[T]) {
    def toIO: IO[T] = IO.fromFuture(IO(cf.asScala)).recover {
      case exc: CompletionException => throw exc.getCause
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy