Package space.kscience.kmath.streaming

Types

Link copied to clipboard
class RingBuffer<T>(buffer: MutableBuffer<T?>, startIndex: Int, size: Int) : Buffer<T>

Thread-safe ring buffer

Functions

Link copied to clipboard
fun <T> Buffer<T>.asFlow(): Flow<T>

Create a Flow from buffer

Link copied to clipboard
fun Flow<Double>.chunked(bufferSize: Int): Flow<DoubleBuffer>

Specialized flow chunker for real buffer

fun <T> Flow<T>.chunked(bufferSize: Int, bufferFactory: BufferFactory<T>): Flow<Buffer<T>>

Collect incoming flow into fixed size chunks

Link copied to clipboard
fun <T> Flow<Buffer<T>>.spread(): Flow<T>

Flat map a Flow of Buffer into continuous Flow of elements

Link copied to clipboard
fun <T> Flow<T>.windowed(window: Int): Flow<Buffer<T>>

Map a flow to a moving window buffer. The window step is one. To get different steps, one could use skip operation.