File: frommarbles_error.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 (14 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import reactivex
from reactivex import operators as ops

"""
Specify the error to be raised in place of the # symbol.
"""

err = ValueError("I don't like 5!")

src0 = reactivex.from_marbles("12-----4-----67--|", timespan=0.2)
src1 = reactivex.from_marbles("----3----5-#      ", timespan=0.2, error=err)

source = reactivex.merge(src0, src1).pipe(ops.do_action(print))
source.run()