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

sttp.client4.httpclient.zio.ZioSequencer.scala Maven / Gradle / Ivy

package sttp.client4.httpclient.zio

import sttp.client4.internal.httpclient.Sequencer
import zio.{Semaphore, Task, UIO}

private[zio] class ZioSequencer(s: Semaphore) extends Sequencer[Task] {
  override def apply[T](t: => Task[T]): Task[T] = s.withPermit(t)
}

private[zio] object ZioSequencer {
  def create: UIO[ZioSequencer] = Semaphore.make(1).map(new ZioSequencer(_))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy