File: frommarbles_merge.py

package info (click to toggle)
python-rx 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,204 kB
  • sloc: python: 39,525; javascript: 77; makefile: 24
file content (13 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import reactivex
from reactivex import operators as ops

"""
simple example that merges two cold observables.
"""

source0 = reactivex.cold("a-----d---1--------4-|", timespan=0.01)
source1 = reactivex.cold("--b-c-------2---3-|   ", timespan=0.01)

observable = reactivex.merge(source0, source1).pipe(ops.to_iterable())
elements = observable.run()
print("received {}".format(list(elements)))