Skip to content

Commit 8bb6e22

Browse files
authored
chore: Remove SupervisedGraphStageLogic (#1619)
1 parent 65fc751 commit 8bb6e22

File tree

4 files changed

+56
-30
lines changed

4 files changed

+56
-30
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.alsoTo")
219
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.alsoToContext")
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.wireTap")
2-
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.wireTapContext")
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.wireTap")
19+
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.stream.scaladsl.FlowWithContextOps.wireTapContext")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Remove SupervisedGraphStageLogic
19+
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.stream.impl.fusing.SupervisedGraphStageLogic")

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)