bastion icon indicating copy to clipboard operation
bastion copied to clipboard

Tracking issue for building Streaming primitives

Open vertexclique opened this issue 4 years ago • 0 comments

First; Feel free to edit or comment on this issue (like every other issue of this project).

We are getting close one step at a time to building a completely backpressure-aware, asynchronous streaming approach.

For this, we need to define couple of terminology in this tracking issue and mark what we might want to implement as primitives in Bastion, and then moving forward what should be self-contained in Bastion Streams.

A list of primitives follows as a list by what they do and how do we implement them.

Basic Operators

  • [ ] Map: distributes elements to the downstream with the help of dispatcher.
  • [ ] FlatMap: associative version of Map for collections.
  • [ ] Throttle: limits the throughput to a specific number of elements per time unit
  • [ ] Limit: limit number of the element from upstream to given max number.
  • [ ] Log: log elements flowing through
  • [ ] Sliding: provide a sliding window over the incoming stream and pass the windows as groups of elements downstream
  • [ ] Take: pass n incoming elements downstream and then complete
  • [ ] TakeWhile: pass elements downstream as long as a predicate function return true for the element include the element when the predicate first return false and then complete
  • [ ] GroupBy: demultiplex the incoming stream into separate output streams (IMO this would be the hardest)

Backpressure aware operators

  • [ ] Buffer: allows for temporarily faster upstream events by buffering size elements

Fan-In

  • [ ] Merge: merge two distinct stream flows
  • [ ] MergePreferred: merge two distinct stream flows with a having one as a higher priority

Fan-Out

  • [ ] Broadcast: broadcast incoming elements to n different stream flows.
  • [ ] Partition: distribute incoming elements to n different stream flows based on the predicate function

Error Handling

  • [ ] OnErrorWithBackoff: backpressure the upcoming elements and re-enqueue the erroring element internally with a backoff.

Please copy this to your project with referring the Bastion project. Thanks!

vertexclique avatar Feb 29 '20 13:02 vertexclique