Skip to content

Batching, Time Control, Sharding and Zipping Operators

johnmcclean-aol edited this page Mar 23, 2015 · 2 revisions

shard

shard allows a Stream to be partitioned by a function into multiple Streams.

eagerfuturestream shard

skipUntil

skipUntil drops all elements from the current stream until the Stream provided as a parameter starts emitting data.

eagerfuturestream skipuntil

takeUntil

takeUntil ensures the current Stream emits data until the the supplied Stream starts emitting data (then the current Stream will be closed).

eagerfuturestream takeuntil

Zip operators

combineLatest

combineLatest takes the latest values from two Streams, unlike Zip however it does not wait for both Stream to emit new elements. Will use the last from the other Stream when one Stream emits a new element.

eagerfuturestream combinelatest

withLatest

withLatest takes the latest value from the current Stream when it emits a new value and combines it with the most recently emitted value from the provided Stream.

eagerfuturestream withlatest

Control operators

debounce

http://whatis.techtarget.com/definition/debouncing

Only allow a single element through within a specified time period, elements that aren't passed through are dropped

eagerfuturestream debounce

onePer & xPer

only allow one (or x) elements through in specified time period - slowing down the overall rate of flow. All elements are passed through.

fixedDelay

Imposes a fixedDelay between elements as they pass through the Stream

##Batching & Chunking operators

Batch

Batch takes a function to group elements into batches as they flow through. Provided functions include batchByTime and batchBySize.

eagerfuturestream batch

chunkSinceLastRead

chunks data passed through since last loop of iteration together into a batch.

eagerfuturestream chunksincelastread

Clone this wiki locally