hstraub / akka-streams-examples

Learning Akka Streams with examples. Akka Streams Version 1.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project

Learning Akka Streams 1.0 with simple examples.

Examples

  • InMemory: running a simple stream.
  • DefineStreams: running a simple Sink.fold stream - calculate the sum of an integer stream.
  • ReactiveTweets: stream filters case class objects.
  • FileReader: reading file content and output the content to stdout
  • EchoServer: an echo tcp server implementation in four lines :)
  • SimpleServer: tcp server understands one command.
  • ReplClient: tcp server understands two commands.
  • SinkActorRef: connect a simple actor as sink.
  • MyActorSubscriber: ActorSubscriber example
  • HttpClientFlowBased: reading from urls and write the content to stdout and calculates the packet and byte count. Two implementations: onComplete and functional.
  • HttpClientFlowBased2: reading from urls and write the content to stdout and calculates the packet and byte count (functional).
  • HttpClientFlowBased3: reading from Elasticsearch or CouchDb and store the content into Elasticsearch. Implementation with two asynchrous streams.
  • Group: Using Flow.group and groupWithin: Chunk up this stream into groups of the given size or within a time window. Todo: terminate a running stream.
  • BalanceMerge: Using Balance and merge. Split the implementation in a Flows and Graphs object.
  • TcpServer2: Same as EchoServer, but reusing the Flows and Graphs definitions from BalanceMerge.
  • HttpLowLevelServer: using the akka http low level server API.
  • HttpLowLevelServerAsync: the async implementation.
  • HttpLowLevelServerAsyncFlow: running a flow on the HttpRequest data.
  • HttpHighLevelServerMinimal: using the akka http high level server API and requires akka-http-xml-experimental (build.sbt).
  • HttpHighLevelServerRoutes: playing with route composition.

Requirements

Build instructions

Requirements: java >= 1.6, sbt, optional scala-ide

git clone ...

Build and run:

sbt run

Prepare Scala-Ide:

sbt eclipse

and import project.

Documents

Typesafe Webinars

Worth reading

About

Learning Akka Streams with examples. Akka Streams Version 1.0


Languages

Language:Scala 100.0%