Questions tagged [rx-py]

Reactive Extensions for Python

RxPY is a library for composing asynchronous and event-based programs using observable collections and LINQ-style query operators in Python.

RxPY is open sourced and available under the Apache License, Version 2.0

96 questions
1
vote
2 answers

Combining Observables when both change simultaneously

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…
John David Reaver
  • 1,238
  • 1
  • 10
  • 17
0
votes
0 answers

Rxpy emit certain values with timeout

I have a stream that emits an array of values, which is aggregated as toggleable array values in a subject, i.e. a list of integers. I would like to emit only a specific value when a certain integer is given, then return to the list of integers…
John Ericksen
  • 10,995
  • 4
  • 45
  • 75
0
votes
1 answer

RXPY semaphore filter

I'm looking to execute a batch of processes in parallel, but process each batch in series using RXPY (we're using v3 right now). Each process is kicked off, then I use RXPY to wait for a set amount of time before ending the process. Here's a basic…
John Ericksen
  • 10,995
  • 4
  • 45
  • 75
0
votes
0 answers

RxPy and asyncio for Server-Client communication

I am trying to develop an application consisting of a Server and a bunch of Clients that should work like this: each Client itself will listen to an independent websocket consisting of some information they will then process this information and…
0
votes
1 answer

Rx Python - subscription to subject in main thread but on_next in background thread

I am trying to use python reactivex (version 4.2) to move data generated in a background thread back into the main thread. So far I have the following code: from reactivex import operators as ops from reactivex.scheduler import…
aleksk
  • 661
  • 7
  • 15
0
votes
3 answers

Filtering another stream based on item in current stream using rxpy

I want to find a match in another stream and combine it with current item. numbers = [1, 2, 3, 4, 5] numbers_in_char = ["2", "1", "3", "5", "4"] textnumbers_in_stream = rx.defer(rx.from_iterable(numbers_in_char)) def exists_in_words(number,…
slawalata
  • 389
  • 1
  • 2
  • 14
0
votes
1 answer

How to accumulate a DataFrame in RxPy?

I'm simulating a calculation over a number of inputs which take a long while. Whenever a calculation is done (i.e. on_next is emitted), I hope to reactively append the result to a results data frame and print the final DF when on_completed is…
TMOTTM
  • 3,286
  • 6
  • 32
  • 63
0
votes
1 answer

rx.interval and rx.timer not producing results

I am currently trying to learn to use RxPy but run into the following. I tried the use of both rx.timer and rx.interval but both produce no output. My code: print("python version = {}".format(sys.version)) # 3.8.10 print("rx version =…
0
votes
0 answers

Infinite loop implementation for event based reactive app in python

I want to write an application that will infinitely generate events and process them in different ways. Precisely, let's say I want to measure temperature each minute and depending on that adjust climate control. I decided to use RxPY and idea is to…
Leonid Bor
  • 2,064
  • 6
  • 27
  • 47
0
votes
2 answers

How to synchronize rx pipes in Python?

I use RxPy for using processing files and I want to build sequence of pipe loading pool_scheduler = ThreadPoolScheduler(multiprocessing.cpu_count()) rx.from_list(independing_files).pipe( self._build_dataflow(), …
DisplayName
  • 219
  • 4
  • 23
0
votes
1 answer

Handling websocket disconnect in Python Flask server using RxPY for push based events

Context I am using RxPY to enable sending push based events via websockets. I am using flask-sockets in a Flask server with gevent. The events class contains an rx.subject.BehaviorSubject that acts as an event publisher, while the websocket clients…
Alex Predescu
  • 792
  • 2
  • 7
  • 24
0
votes
1 answer

How to send RxPy data stream to frontend javascript

I'm trying to get python ReactiveX stream (using RxPy library) to be sent to a javascript on Web UI component, but I can't seem to find a way to do so. Also, I might need to get the data stream coming into the Javascript into a RxJS Observable of…
gigio
  • 11
  • 3
0
votes
1 answer

Observable - subscribe & process only the latest available for each invocation

assume you have an Observable stream of values which pushes a values very fast. Now let's say you have a subscriber which needs to update a record in a database with the latest values from this observable stream, i.e. a somewhat slow I/O bound…
Bogey
  • 4,926
  • 4
  • 32
  • 57
0
votes
1 answer

How to store Observer on_completed result

I am relatively new to Rx and RxPy - there is one fundamental thing that I am trying to do which is access a value that I store at the end of an Observer on_completed. I have a feeling I am either missing something very obvious, or I am perhaps…
0
votes
1 answer

How to implement this use case in RxPY v3

I have found Reactive very difficult to adopt. I believe my problem is that the examples are too simplistic, so I am unsure how to structure a real-world solution. I am hoping that someone will help me to get over the hump by helping me to solve a…
greymatter
  • 840
  • 1
  • 10
  • 25