Labeled Observable

Rocket.labeledFunction
labeled(names::Val, stream)

Creation operator for the LabeledObservable that wraps given stream, that produces Tuple values into a NamedTuple with given names.

Arguments

  • names: a Val object that contains a tuple of symbols
  • stream: an observable that emits a Tuple, length of the Tuple events must be equal to the length of the names argument

Examples

using Rocket

source = labeled(Val((:x, :y)), from([ (1, 2), (2, 3), (3, 4) ]))
subscribe!(source, logger())
;

# output

[LogActor] Data: (x = 1, y = 2)
[LogActor] Data: (x = 2, y = 3)
[LogActor] Data: (x = 3, y = 4)
[LogActor] Completed

See also: ScheduledSubscribable, subscribe!, from

source