@@ -154,6 +154,7 @@ object Futures {
154154 /**
155155 * Creates an already completed CompletionStage with the specified exception
156156 */
157+ @ deprecated(" Use `CompletableFuture.failedStage` instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
157158 def failedCompletionStage [T ](ex : Throwable ): CompletionStage [T ] = {
158159 val f = CompletableFuture .completedFuture[T ](null .asInstanceOf [T ])
159160 f.obtrudeException(ex)
@@ -274,6 +275,7 @@ object japi {
274275 * Java API
275276 */
276277@ nowarn(" msg=deprecated" )
278+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
277279abstract class OnSuccess [- T ] extends japi.CallbackBridge [T ] {
278280 protected final override def internal (result : T ) = onSuccess(result)
279281
@@ -292,6 +294,7 @@ abstract class OnSuccess[-T] extends japi.CallbackBridge[T] {
292294 * Java API
293295 */
294296@ nowarn(" msg=deprecated" )
297+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
295298abstract class OnFailure extends japi.CallbackBridge [Throwable ] {
296299 protected final override def internal (failure : Throwable ) = onFailure(failure)
297300
@@ -310,6 +313,7 @@ abstract class OnFailure extends japi.CallbackBridge[Throwable] {
310313 * Java API
311314 */
312315@ nowarn(" msg=deprecated" )
316+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
313317abstract class OnComplete [- T ] extends japi.CallbackBridge [Try [T ]] {
314318 protected final override def internal (value : Try [T ]): Unit = value match {
315319 case Failure (t) => onComplete(t, null .asInstanceOf [T ])
@@ -333,6 +337,7 @@ abstract class OnComplete[-T] extends japi.CallbackBridge[Try[T]] {
333337 * Java API
334338 */
335339@ nowarn(" msg=deprecated" )
340+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
336341abstract class Recover [+ T ] extends japi.RecoverBridge [T ] {
337342 protected final override def internal (result : Throwable ): T = recover(result)
338343
@@ -373,6 +378,7 @@ abstract class Recover[+T] extends japi.RecoverBridge[T] {
373378 * thus Java users should prefer `Future.map`, translating non-matching values
374379 * to failure cases.
375380 */
381+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
376382object Filter {
377383 @ nowarn(" msg=deprecated" )
378384 def filterOf [T ](f : pekko.japi.Function [T , java.lang.Boolean ]): (T => Boolean ) =
@@ -388,6 +394,7 @@ object Filter {
388394 * Java API
389395 */
390396@ nowarn(" msg=deprecated" )
397+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
391398abstract class Foreach [- T ] extends japi.UnitFunctionBridge [T ] {
392399 override final def internal (t : T ): Unit = each(t)
393400
@@ -410,6 +417,7 @@ abstract class Foreach[-T] extends japi.UnitFunctionBridge[T] {
410417 *
411418 * Java API
412419 */
420+ @ deprecated(" Use Java's CompletableFuture instead, will be removed in Pekko 2.0.0" , " Pekko 1.2.0" )
413421abstract class Mapper [- T , + R ] extends scala.runtime.AbstractFunction1 [T , R ] {
414422
415423 /**
0 commit comments