Questions tagged [rx-scala]

RxScala – Reactive Extensions for Scala

RxScala is a library for composing asynchronous and event-based programs using observable sequences.

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

91 questions
1
vote
2 answers

RxScala recursive stream with timeout

I'm trying to recursively define an observable that either emits items from a subject or, if a certain amount of time passes, a default value, in this case I'm using the timer's default value of zero. I'm using RxScala and have begun with the…
fido
  • 5,566
  • 5
  • 24
  • 20
1
vote
3 answers

How to add a method to Observable trait?

I would like to add a method to the Observable class. What I have done so far was: object Extension { implicit class ObservableExtensions(obs: Observable[Double]) extends Observable{ def fakeMethod (alpha: Double): Observable[Double] = { …
mastro
  • 619
  • 1
  • 8
  • 17
1
vote
1 answer

How to remove event filters when filterEvents() is used?

Hello I want to use rxscala and scalafx together so I did this to re-package mouse events: def mouseEvents: Observable[MouseEvent] = Observable.create(observer => { stage.filterEvent(MouseEvent.Any)((event: MouseEvent) => { …
0
votes
1 answer

Is there an Operation to block onComplete?

I am trying to learn reactive programming, so forgive me if I ask a silly question. I'm also open to advice on changing my design. I am working in scala-swing to display the results of a simulator. With one setting, a chart is displayed as a…
Jonathan Card
  • 122
  • 1
  • 8
0
votes
1 answer

How can I make an actor class to observable in scala

I've tried to make my actor class observable (extends Actor with Observable[T]). However, there is an error message that I have to implement the asJavaObserver value but there is no asJavaObserver in observable trait.
0
votes
1 answer

Testing rx-observables from Futures/Iterables

I have: val observable: Observable[Int] = Observable.from(List(5)) and I can test that the input list is indeed passed on to the observable by testing: materializeValues(observable) should contain (5) where materializeValues is: def…
Maths noob
  • 1,684
  • 20
  • 42
0
votes
1 answer

Converting Rx-Observables to Twitter Futures in Scala

I want to implement the following functions in the most re-active way. I need these for implementing the bijections for automatic conversion between the said types. def convertScalaRXObservableToTwitterFuture[A](a: Observable[A]): TwitterFuture[A] =…
Maths noob
  • 1,684
  • 20
  • 42
0
votes
1 answer

sequencing (parallel) Observables in Outwatch (or zipping)

How should I render a list of Observables in Outwatch? What if I need a single Observable: how should I sequence/zip them as an applicative? Is it expected that it render, when I use the applicative(?) operation 'zip' to transform a …
dcl04
  • 89
  • 8
0
votes
2 answers

How to cache observable in RxJava/RxScala

I have a REST API that calling mongodb using the reactive scala driver which based on RxScala. In my API controllers or services layers, I need to use caching to avoid calls to mongodb using hazelcast (or any other caching tools) All my services…
proximator
  • 687
  • 6
  • 18
0
votes
2 answers

Observable: switch if less than X items emitted

I have a list of observables obs1, obs2, obs3,..., Each of them can emit a number of items (from mongodb database), I am interested only in the first N items. I want to make sure that queries of my observables are executed only if required. In other…
proximator
  • 687
  • 6
  • 18
0
votes
1 answer

mapping over scala rx observables when only onComplete is called

I'm using scala observables to get items from couchbase, then i'm using map,flatMap,zip to transform the result. The problem is that if an item does not exist in couchbase then for example the .zip is not called only onComplete. Example: import…
Jas
  • 14,493
  • 27
  • 97
  • 148
0
votes
1 answer

Why rxScala Observable zipWith evaluates to Observable[Nothing]

I tried the below: import rx.lang.scala.Observable Observable.from(Seq(1,2)).zipWith(Observable.from(Seq(3,4))) When I show the resulting type I see: ((Int, Int) => Nothing) => Observable[Nothing] I'm trying to get into an Observable[Int, Int] ,…
Jas
  • 14,493
  • 27
  • 97
  • 148
0
votes
3 answers

RxScala "zip" multiple Observables

In RxScala how to "zip" more than 2 Observables? val ob1: Observable[Int] = Observable.from(Future(10)) val ob2: Observable[Int] = Observable.from(Future(20)) val ob3: Observable[Int] = Observable.from(Future(30)) "zip" works perfect with 2…
sravis
  • 3,562
  • 6
  • 36
  • 73
0
votes
1 answer

Call Java library (rxjava-extras) code in RxScala application

I am consuming messages from Kafka in an RxScala application and would like to process the messages in a sliding window of dynamic size, i.e. I want to group all messages that were created within the same 2 seconds. RxScala does not provide this…
BenScape
  • 149
  • 3
  • 11
0
votes
1 answer

Combining groupBy and flatMap(maxConcurrent, ...) in RxJava/RxScala

I have incoming processing requests, of which I want do not want too many processing concurrently due to depleting shared resources. I also would prefer requests which share some unique key to not be executed concurrently: def process(request:…
dtech
  • 13,741
  • 11
  • 48
  • 73