!str split Framing into javadsl and scaladsl

This commit is contained in:
Konrad Malawski 2016-02-16 17:47:27 +01:00
parent 5d3a8256c1
commit c25e0abab6
14 changed files with 178 additions and 23 deletions

View file

@ -7,7 +7,7 @@ import java.util.concurrent.CompletionStage;
import java.util.concurrent.ConcurrentLinkedQueue;
import akka.NotUsed;
import akka.stream.io.Framing;
import akka.stream.javadsl.Framing;
import docs.AbstractJavaTest;
import docs.stream.SilenceSystemOut;
import java.net.InetSocketAddress;

View file

@ -7,7 +7,7 @@ import akka.NotUsed;
import akka.actor.ActorSystem;
import akka.stream.ActorMaterializer;
import akka.stream.Materializer;
import akka.stream.io.Framing;
import akka.stream.javadsl.Framing;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.Source;
import akka.testkit.JavaTestKit;

View file

@ -24,7 +24,7 @@ which will emit an :class:`IncomingConnection` element for each new connection t
Next, we simply handle *each* incoming connection using a :class:`Flow` which will be used as the processing stage
to handle and emit ByteStrings from and to the TCP Socket. Since one :class:`ByteString` does not have to necessarily
correspond to exactly one line of text (the client might be sending the line in chunks) we use the ``delimiter``
helper Flow from ``akka.stream.io.Framing`` to chunk the inputs up into actual lines of text. The last boolean
helper Flow from ``akka.stream.javadsl.Framing`` to chunk the inputs up into actual lines of text. The last boolean
argument indicates that we require an explicit line ending even for the last message before the connection is closed.
In this example we simply add exclamation marks to each incoming text message and push it through the flow: