Coder Social home page Coder Social logo

akka-streams-consecutive's Introduction

Akka Streams Consecutive

Example of how to expand a stream into one with consecutive elements.

Usecase: Product catalogs of different tenants have to be merged together for displaying them localized.

Requirement: the streams have to be sorted (easily doable by querying them sorted from the underlying datastore)

deProducts

id name
1 Deutsches Produkt mit id 1
2 Deutsches Produkt mit id 2
5 Deutsches Produkt mit id 5
8 Deutsches Produkt mit id 8
9 Deutsches Produkt mit id 9
10 Deutsches Produkt mit id 10
12 Deutsches Produkt mit id 12

enProducts

id name
2 English Product with id 2
4 English Product with id 4
8 English Product with id 8
9 English Product with id 9
11 English Product with id 11

zipped

de id de product en id en product
1 Deutsches Produkt mit id 1 1 ---
2 Deutsches Produkt mit id 2 2 English Product with id 2
3 --- 3 ---
4 --- 4 English Product with id 4
5 Deutsches Produkt mit id 5 5 ---
6 --- 6 ---
7 --- 7 ---
8 Deutsches Produkt mit id 8 8 English Product with id 8
9 Deutsches Produkt mit id 9 9 English Product with id 9
10 Deutsches Produkt mit id 10 10 ---
11 --- 11 English Product with id 11
12 Deutsches Produkt mit id 12 12 ---

cleaned up (empty elements removed)

de id de product en id en product
1 Deutsches Produkt mit id 1 1 ---
2 Deutsches Produkt mit id 2 2 English Product with id 2
4 --- 4 English Product with id 4
5 Deutsches Produkt mit id 5 5 ---
8 Deutsches Produkt mit id 8 8 English Product with id 8
9 Deutsches Produkt mit id 9 9 English Product with id 9
10 Deutsches Produkt mit id 10 10 ---
11 --- 11 English Product with id 11
12 Deutsches Produkt mit id 12 12 ---

akka-streams-consecutive's People

Contributors

flowi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.