Skip to content

Commit d02ee77

Browse files
committed
chore: Remove SupervisedGraphStageLogic
1 parent 7184dad commit d02ee77

File tree

1 file changed

+1
-28
lines changed
  • stream/src/main/scala/org/apache/pekko/stream/impl/fusing

1 file changed

+1
-28
lines changed

stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import scala.util.control.Exception.Catcher
2727

2828
import org.apache.pekko
2929
import pekko.actor.{ ActorRef, Terminated }
30-
import pekko.annotation.{ DoNotInherit, InternalApi }
30+
import pekko.annotation.InternalApi
3131
import pekko.event._
3232
import pekko.event.Logging.LogLevel
3333
import pekko.stream.{ Supervision, _ }
@@ -206,33 +206,6 @@ import pekko.util.ccompat._
206206
override def toString = "DropWhile"
207207
}
208208

209-
/**
210-
* INTERNAL API
211-
*/
212-
@DoNotInherit private[pekko] abstract class SupervisedGraphStageLogic(inheritedAttributes: Attributes, shape: Shape)
213-
extends GraphStageLogic(shape) {
214-
private lazy val decider = inheritedAttributes.mandatoryAttribute[SupervisionStrategy].decider
215-
216-
def withSupervision[T](f: () => T): Option[T] =
217-
try {
218-
Some(f())
219-
} catch {
220-
case NonFatal(ex) =>
221-
decider(ex) match {
222-
case Supervision.Stop => onStop(ex)
223-
case Supervision.Resume => onResume(ex)
224-
case Supervision.Restart => onRestart(ex)
225-
}
226-
None
227-
}
228-
229-
def onResume(t: Throwable): Unit
230-
231-
def onStop(t: Throwable): Unit = failStage(t)
232-
233-
def onRestart(t: Throwable): Unit = onResume(t)
234-
}
235-
236209
private[stream] object Collect {
237210
// Cached function that can be used with PartialFunction.applyOrElse to ensure that A) the guard is only applied once,
238211
// and the caller can check the returned value with Collect.notApplied to query whether the PF was applied or not.

0 commit comments

Comments
 (0)