EventStream Operations - seadowg/milo GitHub Wiki

Operations:

These are the operations an EventStream should support:

  • map - map each element of the stream using the given function
  • filter - return a stream that only contains elements that render a true value with the given function
  • merge - interleave (using implicit timestamps) the receiver and passed streams
  • zip - return a stream where element is the corresponding element of the receiver and given streams ie. ((t1,x), (t2, y)) where t2 = min(ev2.filter(_.time <= t1)) or vise versa
  • take - returns the first n elements of the stream (useful for optimisation?)
  • takeWhile - conditional version of take producing a possibly finite stream
  • scan - take a zero value and a function and apply the function result of the last computation and the current element (first computation being the zero value)