Merge pull request #19802 from ktoso/wip-framing-made-proper-ktoso

!str split Framing into javadsl and scaladsl
This commit is contained in:
Konrad Malawski 2016-02-16 20:53:34 +01:00
commit 650e94ba30
15 changed files with 218 additions and 26 deletions

View file

@ -8,7 +8,7 @@ import java.io.File
import akka.Done
import akka.actor.ActorRef
import akka.http.scaladsl.model.Multipart.FormData.BodyPart
import akka.stream.io.{ Framing }
import akka.stream.scaladsl.Framing
import akka.stream.scaladsl._
import akka.http.scaladsl.model.Multipart
import akka.util.ByteString

View file

@ -4,7 +4,7 @@
package docs.http.scaladsl.server.directives
import akka.http.scaladsl.model._
import akka.stream.io.Framing
import akka.stream.scaladsl.Framing
import akka.util.ByteString
import docs.http.scaladsl.server.RoutingSpec
import scala.concurrent.Future

View file

@ -21,7 +21,7 @@ class RecipeParseLines extends RecipeSpec {
ByteString("\r\n\r\n")))
//#parse-lines
import akka.stream.io.Framing
import akka.stream.scaladsl.Framing
val linesStream = rawData.via(Framing.delimiter(
ByteString("\r\n"), maximumFrameLength = 100, allowTruncation = true))
.map(_.utf8String)

View file

@ -39,7 +39,7 @@ class StreamTcpDocSpec extends AkkaSpec {
{
val (host, port) = TestUtils.temporaryServerHostnameAndPort()
//#echo-server-simple-handle
import akka.stream.io.Framing
import akka.stream.scaladsl.Framing
val connections: Source[IncomingConnection, Future[ServerBinding]] =
Tcp().bind(host, port)
@ -66,7 +66,7 @@ class StreamTcpDocSpec extends AkkaSpec {
val connections = Tcp().bind(localhost.getHostName, localhost.getPort) // TODO getHostString in Java7
val serverProbe = TestProbe()
import akka.stream.io.Framing
import akka.stream.scaladsl.Framing
//#welcome-banner-chat-server
connections.runForeach { connection =>
@ -97,7 +97,7 @@ class StreamTcpDocSpec extends AkkaSpec {
}
//#welcome-banner-chat-server
import akka.stream.io.Framing
import akka.stream.scaladsl.Framing
val input = new AtomicReference("Hello world" :: "What a lovely day" :: Nil)
def readLine(prompt: String): String = {