Skip to content

Commit

Permalink
lift mapMaterializedValue to FlowOpsMat
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuhn committed Mar 24, 2016
1 parent 777a400 commit 8a3cf81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion akka-stream/src/main/scala/akka/stream/scaladsl/Flow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ final class Flow[-In, +Out, +Mat](private[stream] override val module: Module)
/**
* Transform the materialized value of this Flow, leaving all other properties as they were.
*/
def mapMaterializedValue[Mat2](f: Mat Mat2): ReprMat[Out, Mat2] =
override def mapMaterializedValue[Mat2](f: Mat Mat2): ReprMat[Out, Mat2] =
new Flow(module.transformMaterializedValue(f.asInstanceOf[Any Any]))

/**
Expand Down Expand Up @@ -1983,6 +1983,11 @@ trait FlowOpsMat[+Out, +Mat] extends FlowOps[Out, Mat] {
def watchTermination[Mat2]()(matF: (Mat, Future[Done]) Mat2): ReprMat[Out, Mat2] =
viaMat(GraphStages.terminationWatcher)(matF)

/**
* Transform the materialized value of this graph, leaving all other properties as they were.
*/
def mapMaterializedValue[Mat2](f: Mat Mat2): ReprMat[Out, Mat2]

/**
* INTERNAL API.
*/
Expand Down
4 changes: 2 additions & 2 deletions akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import scala.compat.java8.FutureConverters._
* a Reactive Streams `Publisher` (at least conceptually).
*/
final class Source[+Out, +Mat](private[stream] override val module: Module)
extends FlowOpsMat[Out, Mat] with Graph[SourceShape[Out], Mat] {
extends FlowOpsMat[Out, Mat] with Graph[SourceShape[Out], Mat] {

override type Repr[+O] = Source[O, Mat @uncheckedVariance]
override type ReprMat[+O, +M] = Source[O, M]
Expand Down Expand Up @@ -71,7 +71,7 @@ final class Source[+Out, +Mat](private[stream] override val module: Module)
/**
* Transform only the materialized value of this Source, leaving all other properties as they were.
*/
def mapMaterializedValue[Mat2](f: Mat Mat2): ReprMat[Out, Mat2] =
override def mapMaterializedValue[Mat2](f: Mat Mat2): ReprMat[Out, Mat2] =
new Source[Out, Mat2](module.transformMaterializedValue(f.asInstanceOf[Any Any]))

/** INTERNAL API */
Expand Down
3 changes: 3 additions & 0 deletions project/MiMa.scala
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ object MiMa extends AutoPlugin {
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.impl.fusing.Drop.onPush"),
ProblemFilters.exclude[FinalClassProblem]("akka.stream.stage.GraphStageLogic$Reading"), // this class is private

// lifting this method to the type where it belongs
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.stream.scaladsl.FlowOpsMat.mapMaterializedValue"),

// #19908 Take is private
ProblemFilters.exclude[MissingClassProblem]("akka.stream.impl.Stages$Take$"),
ProblemFilters.exclude[MissingClassProblem]("akka.stream.impl.Stages$Take"),
Expand Down

0 comments on commit 8a3cf81

Please sign in to comment.