Skip to content

Commit

Permalink
drop debugging code in Promise
Browse files Browse the repository at this point in the history
  • Loading branch information
lbialy committed Oct 1, 2024
1 parent c78eece commit 5ebf7e2
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions core/src/main/scala/besom/internal/Result.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,9 @@ trait Promise[A]:

object Promise:
def apply[A](): Result[Promise[A]] = Result.defer {
import scala.concurrent.ExecutionContext.Implicits.global // TODO DROP THIS
import scala.concurrent.blocking
new Promise:
private val internal = scala.concurrent.Promise[A]()

Future { // TODO DROP THIS
blocking {
Thread.sleep(1000L * 60 * 1) // 1 minute timeout
}
internal.failure(Exception("Promise timed out!"))
}

override def get: Result[A] = Result.deferFuture(internal.future)
override def isCompleted: Result[Boolean] = Result.defer(internal.isCompleted)
override def fulfill(a: A): Result[Unit] = Result.defer(internal.success(a))
Expand Down

0 comments on commit 5ebf7e2

Please sign in to comment.