Convert Play Framework java Promise to Play Framework Scala Promise -
Convert Play Framework java Promise to Play Framework Scala Promise -
i building scala play framework app uses library homecoming results f.promise (java promise). there way convert f.promises (https://www.playframework.com/documentation/2.1.0/api/java/play/libs/f.promise.html) scala promises or wrapped scala future out of f.promise?
the way see far getting f.promise blocking operation , go on working asynchronous.
the way descriped in first reply led me code. unfortunately dont know how define f.function correctly. code not compile.
answer: so, found out f.promise has method called wrapped(). , method gives scala future back.
it turns out class f.promise (java.play) has method called wrapped()
returns scala.concurrente.future
wrapped promise. have calling wrapped on f.promise.
val promise: f.promise[t] = getpromise() val future : future[t] = promise.wrapped()
java scala playframework promise
Comments
Post a Comment