-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Akka Cookbook
By :
One of the most common scenarios of streaming is input-output applications. Nowadays, almost any modern application uses I/O to communicate with external entities or services. This is usually achieved by either listening on a port or pushing data to a remote system. For example, this concept is what the Internet of Things relies on when machines use I/O to contact with each other.
Akka Streams provide a set of Sources and Sinks to use files, InputStreams, and OutputStreams in your streams. In this recipe, we will create a stream to listen for words and count them as they come.
In this recipe, we will create a stream that will listen for TCP connections on port 1234. Once it receives an incoming message from the stream, it will count its words and return the counts in ByteString.
For this recipe, perform the following steps:
WorkingIOStreamsApplication.scala inside the com.packt.chapter8 package. This object instantiates...