io.youi.communication.HookupRequest.scala Maven / Gradle / Ivy
The newest version!
package io.youi.communication
import scala.concurrent.Promise
case class HookupRequest(request: Message, promise: Promise[Message]) {
def isRunning: Boolean = request.`type`.running
def success(response: Message): Unit = if (!promise.isCompleted) promise.success(response)
def failure(throwable: Throwable): Unit = if (!promise.isCompleted) promise.failure(throwable)
}