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

io.kinoplan.utils.implicits.zio.ZioSyntax.scala Maven / Gradle / Ivy

The newest version!
package io.kinoplan.utils.implicits.zio

import zio.{CancelableFuture, Unsafe, ZIO}

final private[implicits] class ZioOps[E <: Throwable, A](private val value: ZIO[Any, E, A]) {

  def runToFuture: CancelableFuture[A] = Unsafe.unsafe { implicit unsafe =>
    zio.Runtime.default.unsafe.runToFuture[E, A](value)
  }

}

trait ZioSyntax {

  implicit final def syntaxZioOps[E <: Throwable, A](value: ZIO[Any, E, A]): ZioOps[E, A] =
    new ZioOps[E, A](value)

}

object ZioSyntax extends ZioSyntax




© 2015 - 2025 Weber Informatics LLC | Privacy Policy