Iterable Observable

Rocket.iterableFunction
iterable(iterator; scheduler::H = AsapScheduler()) where { H <: AbstractScheduler }

Creation operator for the IterableObservable that wraps given iterator into an observable object.

Arguments

  • iterator: an iterator object to be wrapped an observable
  • scheduler: optional, scheduler-like object

Note

iterable operators does not create a copy of iterator. Any changes in the iterator object might be visible in the created observable. For side-effects free behavior consider using from creation operator which creates a copy of a given object with a collect function.

Examples

using Rocket

source = iterable([ 0, 1, 2 ])
subscribe!(source, logger())
;

# output

[LogActor] Data: 0
[LogActor] Data: 1
[LogActor] Data: 2
[LogActor] Completed
using Rocket

source = iterable("Hello")
subscribe!(source, logger())
;

# output

[LogActor] Data: H
[LogActor] Data: e
[LogActor] Data: l
[LogActor] Data: l
[LogActor] Data: o
[LogActor] Completed

See also: ScheduledSubscribable, subscribe!, from

source