SparseStreamAggregator

oxygen.zio.SparseStreamAggregator
See theSparseStreamAggregator companion object
trait SparseStreamAggregator[_RawInput, _Output]

SparseStreamAggregator serves the purpose of being able to aggregate a stream of sparse data.

Example:

Input:

  • (1.some, None, None)
  • (2.some, None, None)
  • (None, true.some, None)
  • (3.some, None, None)
  • (None, None, "A".some)
  • (4.some, None, None)
  • (None, false.some, None)
  • (None, None, "B".some)
  • (None, None, "C".some)
  • (None, None, "D".some)

Output:

  • (1, None, Contiguous())
  • (2, true.some, Contiguous())
  • (3, None, Contiguous("A"))
  • (4, false.some, Contiguous("B", "C", "D"))

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AndThen[_RawInput1, _Output1, _RawInput2, _Output2, _ZipInput, _ZipOutput]
class Leaf[A]
class Many[_RawInput, _Output, S]
class Optional[_RawInput, _Output]

Members list

Type members

Types

final type Input = _Input
final type Output = _Output
final type RawInput = _RawInput
final type State = _State

Value members

Abstract methods

def accept(input: Input): Required[Distinct[State, Output]]
def accept(state: State, input: Input): Required[Ior[State, Output]]
def complete(state: State): Required[Output]

Concrete methods

final def *:[RawInput2, Output2](that: SparseStreamAggregator[RawInput2, Output2])(using zipInput: Zip[RawInput2, RawInput], zipOutput: Zip[Output2, Output]): SparseStreamAggregator[zipInput.Out, zipOutput.Out]

Note: When combining multiple aggs, the LHS will be eagerly emitted. This means that if you do (a *: b) *: c instead of a *: b *: c (which is the same as a *: (b *: c), then you will get errors, because it will be impossible to ever get a c.

Note: When combining multiple aggs, the LHS will be eagerly emitted. This means that if you do (a *: b) *: c instead of a *: b *: c (which is the same as a *: (b *: c), then you will get errors, because it will be impossible to ever get a c.

Attributes

final def accept(state: Option[State], input: Input): Required[Ior[State, Output]]
final def aggregateStream[R, E](stream: ZStream[R, E, RawInput]): ZStream[R, E, Output]
final def complete(state: Option[State]): Required[Output]
final def many[S[_] : SeqOps]: SparseStreamAggregator[RawInput, S[Output]]