Skip to content

Commit 9d40492

Browse files
committed
MiMa and keep compatibility by extending StreamTimeoutException
1 parent 159717b commit 9d40492

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Internal API changed
2+
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.impl.Timers#IdleTimeoutBidi.this")

akka-stream/src/main/scala/akka/stream/StreamTimeoutException.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import akka.annotation.DoNotInherit
1515
* Not for user extension
1616
*/
1717
@DoNotInherit
18-
sealed class StreamTimeoutException(msg: String) extends TimeoutException(msg) with NoStackTrace
18+
class StreamTimeoutException(msg: String) extends TimeoutException(msg) with NoStackTrace
1919

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

akka-stream/src/main/scala/akka/stream/impl/Timers.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@ import akka.stream.stage._
151151

152152
}
153153

154+
private object IdleTimeoutBidi {
155+
val defaultCreateFailure: FiniteDuration => Throwable = timeout =>
156+
new StreamIdleTimeoutException(s"No elements passed in the last ${timeout.toCoarsest}.")
157+
}
154158
final class IdleTimeoutBidi[I, O](
155159
val timeout: FiniteDuration,
156-
createFailure: FiniteDuration => Throwable = timeout =>
157-
new StreamIdleTimeoutException(s"No elements passed in the last ${timeout.toCoarsest}."))
160+
createFailure: FiniteDuration => Throwable = IdleTimeoutBidi.defaultCreateFailure)
158161
extends GraphStage[BidiShape[I, I, O, O]] {
159162
val in1 = Inlet[I]("in1")
160163
val in2 = Inlet[O]("in2")

akka-stream/src/main/scala/akka/stream/scaladsl/Tcp.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package akka.stream.scaladsl
66

77
import java.net.InetSocketAddress
8-
import java.util.concurrent.TimeoutException
98
import javax.net.ssl.SSLContext
109
import javax.net.ssl.SSLEngine
1110
import javax.net.ssl.SSLSession
@@ -508,7 +507,7 @@ final class Tcp(system: ExtendedActorSystem) extends akka.actor.Extension {
508507
}
509508

510509
final class TcpIdleTimeoutException(msg: String, @unused timeout: Duration)
511-
extends TimeoutException(msg: String)
510+
extends StreamTimeoutException(msg: String)
512511
with NoStackTrace // only used from a single stage
513512

514513
object TcpAttributes {

0 commit comments

Comments
 (0)