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

sttp.client4.internal.httpclient.IdSequencer.scala Maven / Gradle / Ivy

The newest version!
package sttp.client4.internal.httpclient

import sttp.shared.Identity

import java.util.concurrent.Semaphore
import scala.concurrent.blocking

private[client4] class IdSequencer extends Sequencer[Identity] {
  private val semaphore = new Semaphore(1)

  def apply[T](t: => T): T = {
    blocking(semaphore.acquire())
    try t
    finally semaphore.release()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy