This is an automated email from the ASF dual-hosted git repository. hepin pushed a commit to branch depTimeout in repository https://gitbox.apache.org/repos/asf/pekko.git
commit b117f5b179395b0f0349e044fe55d504b02c491c Author: He-Pin <[email protected]> AuthorDate: Sat Aug 23 00:49:23 2025 +0800 chore: Deprecate Patterns.timeout method. --- .../main/scala/org/apache/pekko/pattern/FutureTimeoutSupport.scala | 1 + actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/actor/src/main/scala/org/apache/pekko/pattern/FutureTimeoutSupport.scala b/actor/src/main/scala/org/apache/pekko/pattern/FutureTimeoutSupport.scala index f936994601..a608172552 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/FutureTimeoutSupport.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/FutureTimeoutSupport.scala @@ -123,6 +123,7 @@ trait FutureTimeoutSupport { * if the provided value is not completed within the specified duration. * @since 1.2.0 */ + @deprecated("Use `CompletableFuture#orTimeout instead.", "Pekko 2.0.0") def timeoutCompletionStage[T](duration: FiniteDuration, using: Scheduler)(value: => CompletionStage[T])( implicit ec: ExecutionContext): CompletionStage[T] = { val stage: CompletionStage[T] = diff --git a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala index b776be1f08..0c4f3905a6 100644 --- a/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala +++ b/actor/src/main/scala/org/apache/pekko/pattern/Patterns.scala @@ -24,6 +24,8 @@ import pekko.actor.{ ActorSelection, ClassicActorSystemProvider, Scheduler } import pekko.util.FutureConverters._ import pekko.util.JavaDurationConverters._ +import scala.annotation.nowarn + /** * Java API: for Pekko patterns such as `ask`, `pipe` and others which work with [[java.util.concurrent.CompletionStage]]. */ @@ -471,6 +473,8 @@ object Patterns { * if the provided value is not completed within the specified duration. * @since 1.2.0 */ + @deprecated("Use `CompletableFuture#orTimeout instead.", "Pekko 2.0.0") + @nowarn("msg=deprecated") def timeout[T]( duration: java.time.Duration, scheduler: Scheduler, --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
