1

I wanted to create an observable that emits an event at an interval of 100 ms.

I tried using rx.interval:

import rx
tick = rx.interval(100)
tick.subscribe(on_next=lambda i: print(i))

The process is not running and gives the disposable as output:

<rx.disposable.disposable.Disposable object at 0x7f7eac712dd8>

How can I get this done?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Aravind OR
  • 97
  • 2
  • 10

1 Answers1

0

Interval is in seconds. So this works fine:

rx.interval(0.1).subscribe(on_next=lambda i: print(i))
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Aravind OR
  • 97
  • 2
  • 10