BatchStream

lamp.data.BatchStream
See theBatchStream companion object
trait BatchStream[+I, S, C]

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
BatchStream[I, S, C]

Members list

Value members

Abstract methods

def allocateBuffers(target: Device): Resource[IO, C]
def init: S
def nextBatch(device: Device, buffers: C, state: S): IO[(S, Resource[IO, StreamControl[I]])]

May be called from different threads, but always in serial State should be carried over in the state parameter and return type

May be called from different threads, but always in serial State should be carried over in the state parameter and return type

Attributes

Concrete methods

def concat[I2 >: I, S2](other: BatchStream[I2, S2, C]): BatchStream[I2, (Boolean, Either[S, S2]), C]
def drainIntoSeq(device: Device): Resource[IO, Vector[I]]
def everyNth(n: Int, offset: Int): BatchStream[I, (Long, S), C]

Takes only batches where (i % n == offset), i being the number of batch counted from 0

Takes only batches where (i % n == offset), i being the number of batch counted from 0

Attributes

def foldLeft[B](zero: B, device: Device, stateZero: S)(f: (B, I) => IO[B]): IO[B]
def map[I2](f: I => Resource[IO, StreamControl[I2]]): BatchStream[I2, S, C]
def repeatOrTake(requiredLength: Long): BatchStream[I, (Long, S), C]
def take(n: Long): BatchStream[I, (Long, S), C]

Returns a new stream with EmptyBatches filtered out

Returns a new stream with EmptyBatches filtered out

Attributes