Skip to content

Commit

Permalink
MiMa and keep compatibility by extending StreamTimeoutException
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren committed Aug 17, 2023
1 parent 159717b commit 9d40492
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Internal API changed
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.impl.Timers#IdleTimeoutBidi.this")
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import akka.annotation.DoNotInherit
* Not for user extension
*/
@DoNotInherit
sealed class StreamTimeoutException(msg: String) extends TimeoutException(msg) with NoStackTrace
class StreamTimeoutException(msg: String) extends TimeoutException(msg) with NoStackTrace

final class InitialTimeoutException(msg: String) extends StreamTimeoutException(msg)

Expand Down
7 changes: 5 additions & 2 deletions akka-stream/src/main/scala/akka/stream/impl/Timers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,13 @@ import akka.stream.stage._

}

private object IdleTimeoutBidi {
val defaultCreateFailure: FiniteDuration => Throwable = timeout =>
new StreamIdleTimeoutException(s"No elements passed in the last ${timeout.toCoarsest}.")
}
final class IdleTimeoutBidi[I, O](
val timeout: FiniteDuration,
createFailure: FiniteDuration => Throwable = timeout =>
new StreamIdleTimeoutException(s"No elements passed in the last ${timeout.toCoarsest}."))
createFailure: FiniteDuration => Throwable = IdleTimeoutBidi.defaultCreateFailure)
extends GraphStage[BidiShape[I, I, O, O]] {
val in1 = Inlet[I]("in1")
val in2 = Inlet[O]("in2")
Expand Down
3 changes: 1 addition & 2 deletions akka-stream/src/main/scala/akka/stream/scaladsl/Tcp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package akka.stream.scaladsl

import java.net.InetSocketAddress
import java.util.concurrent.TimeoutException
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLEngine
import javax.net.ssl.SSLSession
Expand Down Expand Up @@ -508,7 +507,7 @@ final class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
}

final class TcpIdleTimeoutException(msg: String, @unused timeout: Duration)
extends TimeoutException(msg: String)
extends StreamTimeoutException(msg: String)
with NoStackTrace // only used from a single stage

object TcpAttributes {
Expand Down

0 comments on commit 9d40492

Please sign in to comment.