2015-01-28 14:19:50 +01:00
|
|
|
/**
|
2016-02-23 12:58:39 +01:00
|
|
|
* Copyright (C) 2015-2016 Lightbend Inc. <http://www.lightbend.com>
|
2015-01-28 14:19:50 +01:00
|
|
|
*/
|
|
|
|
|
package akka.stream.impl
|
|
|
|
|
|
|
|
|
|
import akka.stream._
|
|
|
|
|
import akka.stream.impl.StreamLayout.Module
|
2016-03-11 17:08:30 +01:00
|
|
|
import akka.event.Logging
|
2015-01-28 14:19:50 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* INTERNAL API
|
|
|
|
|
*/
|
2016-03-11 17:08:30 +01:00
|
|
|
private[stream] trait FlowModule[In, Out, Mat] extends StreamLayout.AtomicModule {
|
2015-01-28 14:19:50 +01:00
|
|
|
override def replaceShape(s: Shape) =
|
2016-02-15 10:37:19 +01:00
|
|
|
if (s != shape) throw new UnsupportedOperationException("cannot replace the shape of a FlowModule")
|
|
|
|
|
else this
|
2015-01-28 14:19:50 +01:00
|
|
|
|
2015-06-13 16:28:38 -04:00
|
|
|
val inPort = Inlet[In]("Flow.in")
|
|
|
|
|
val outPort = Outlet[Out]("Flow.out")
|
2015-01-28 14:19:50 +01:00
|
|
|
override val shape = new FlowShape(inPort, outPort)
|
|
|
|
|
|
2016-03-11 17:08:30 +01:00
|
|
|
protected def label: String = Logging.simpleName(this)
|
|
|
|
|
final override def toString: String = f"$label [${System.identityHashCode(this)}%08x]"
|
2015-01-28 14:19:50 +01:00
|
|
|
}
|