New materializer and layout
This commit is contained in:
parent
1989ef481d
commit
ba63c7af8d
60 changed files with 4420 additions and 3181 deletions
|
|
@ -2,10 +2,12 @@ package akka.stream.impl.io
|
|||
|
||||
import javax.net.ssl.{ SSLContext, SSLEngine, SSLSession }
|
||||
|
||||
import akka.NotUsed
|
||||
import akka.actor.ActorSystem
|
||||
import akka.stream._
|
||||
import akka.stream.impl.StreamLayout.{ AtomicModule, CompositeModule }
|
||||
import akka.stream.impl.StreamLayout.AtomicModule
|
||||
import akka.stream.TLSProtocol._
|
||||
import akka.stream.impl.TraversalBuilder
|
||||
import akka.util.ByteString
|
||||
import com.typesafe.sslconfig.akka.AkkaSSLConfig
|
||||
|
||||
|
|
@ -16,21 +18,18 @@ import scala.util.Try
|
|||
*/
|
||||
private[stream] final case class TlsModule(plainIn: Inlet[SslTlsOutbound], plainOut: Outlet[SslTlsInbound],
|
||||
cipherIn: Inlet[ByteString], cipherOut: Outlet[ByteString],
|
||||
shape: Shape, attributes: Attributes,
|
||||
shape: BidiShape[SslTlsOutbound, ByteString, ByteString, SslTlsInbound],
|
||||
attributes: Attributes,
|
||||
createSSLEngine: ActorSystem ⇒ SSLEngine, // ActorSystem is only needed to support the AkkaSSLConfig legacy, see #21753
|
||||
verifySession: (ActorSystem, SSLSession) ⇒ Try[Unit], // ActorSystem is only needed to support the AkkaSSLConfig legacy, see #21753
|
||||
closing: TLSClosing) extends AtomicModule {
|
||||
closing: TLSClosing)
|
||||
extends AtomicModule[BidiShape[SslTlsOutbound, ByteString, ByteString, SslTlsInbound], NotUsed] {
|
||||
|
||||
override def withAttributes(att: Attributes): TlsModule = copy(attributes = att)
|
||||
override def carbonCopy: TlsModule = TlsModule(attributes, createSSLEngine, verifySession, closing)
|
||||
|
||||
override def replaceShape(s: Shape) =
|
||||
if (s != shape) {
|
||||
shape.requireSamePortsAs(s)
|
||||
CompositeModule(this, s)
|
||||
} else this
|
||||
|
||||
override def toString: String = f"TlsModule($closing) [${System.identityHashCode(this)}%08x]"
|
||||
|
||||
override private[stream] def traversalBuilder = TraversalBuilder.atomic(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue