rx-py

How to delay event emission with rxpy/rxjs?

不羁岁月 提交于 2019-12-13 14:59:39
问题 I've got two event streams. One is from an inductance loop, the other is an IP camera. Cars will drive over the loop and then hit the camera. I want to combine them if the events are within N milliseconds of each other (car will always hit the loop first), but I also want the unmatched events from each stream (either hardware can fail) all merged into a single stream. Something like this: ---> (only unmatched a's, None) / \ stream_a (loop) \ \ \ --> (a, b) ---------------------------> (Maybe

Is there Intellisense / auto-complete in VisualStudio for the Reactive Extension rx.py?

巧了我就是萌 提交于 2019-12-12 03:44:01
问题 I'm Visual Studio and I've started a new Python project in a Python 3 environment. Rx has been pip installed and I have the following code from rx import Observable xs = Observable.range(1, 10) q = xs.where(lambda x: x % 2 ==0).select(lambda x: -x) q.subscribe(print) It's runs fine but when I typed Observable.ran... I expected to see Intellisense pop up with `range(...)" as an option, as it does normally, but it never did. Why is this and how can I get Intellisense working for it? 来源: https:/

Combining Observables when both change simultaneously

左心房为你撑大大i 提交于 2019-12-08 05:44:32
问题 I am trying to integrate ReactiveX into my GUI using RxPY. This is a general ReactiveX question. Say I have a visualization that depends on multiple Observable streams using combine_latest(stream1, stream2, plot_function) . This works great when one Observable changes, like when the user modifies a value; the visualization updates using the new values. However, sometimes both Observables are updated simultaneously, like when the user loads data for both streams from a single file. Technically

subscribe_on with from_iterable/range in RxPY

让人想犯罪 __ 提交于 2019-12-07 07:56:57
问题 I'm trying to get my head around scheduling in reactive extensions for python. I would like to use subscribe_on to process multiple observables in parallel. This works fine if the observable is created with just , but not if for example range or from_ are used. just defaults to Scheduler.immediate , while other generators default to Scheduler.current_thread . Which causes the difference, but feels inconsistent to me. Probably because I don't grasp the full problem. Consider the following

Combining Observables when both change simultaneously

℡╲_俬逩灬. 提交于 2019-12-06 17:25:46
I am trying to integrate ReactiveX into my GUI using RxPY. This is a general ReactiveX question. Say I have a visualization that depends on multiple Observable streams using combine_latest(stream1, stream2, plot_function) . This works great when one Observable changes, like when the user modifies a value; the visualization updates using the new values. However, sometimes both Observables are updated simultaneously, like when the user loads data for both streams from a single file. Technically, one Observable will be updated before the other (whichever comes first in the import function). As a

Rx: a zip-like operator that continues after one of the streams ended?

不想你离开。 提交于 2019-11-28 13:55:24
I'm looking to combine streams (observables) that start and end asynchronously: -1----1----1----1---|-> -2----2--|-> [ optional_zip(sum) ] -1----3----3----1---|-> What I need it for: Adding audio streams together. They're streams of audio "chunks", but I'm going to represent them with integers here. So there's the first clip playing: -1----1----1----1---|-> and then a second one starts, a bit later: -2----2--|-> The result of combining them by sum should be: -1----3----3----1---|-> But the standard zip completes if any of the zipped streams end. I want this optional_zip to keep going even if