![JAR search and dependency download from the Maven repository](/logo.png)
sbt.PromiseWrap.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of main-settings_2.12 Show documentation
Show all versions of main-settings_2.12 Show documentation
sbt is an interactive build tool
/*
* sbt
* Copyright 2023, Scala center
* Copyright 2011 - 2022, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
import scala.concurrent.{ Promise => XPromise }
final class PromiseWrap[A] {
private[sbt] val underlying: XPromise[A] = XPromise()
def complete(result: Result[A]): Unit =
result match {
case Inc(cause) => underlying.failure(cause)
case Value(value) => underlying.success(value)
}
def success(value: A): Unit = underlying.success(value)
def failure(cause: Throwable): Unit = underlying.failure(cause)
def isCompleted: Boolean = underlying.isCompleted
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy