Questions tagged [rx-java2]
anything related to RxJava2 – The new implementation of the RxJava Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
rx-java2
4,138
questions
-1
votes
1
answer
43
views
RxJava strip bytes at regular interval from a stream and then further extract messages based on length indicator of message bytes
I have a Java inputstream, that I skip 2 bytes every n bytes. Now the output of that are bytes that are clean after stripping the 2 delimiters every n bytes.
This output is a series of bytes where the ...
0
votes
0
answers
9
views
Any case that the return type of a Web API has to be an Observable and can NOT be a Single?
I'm learning RxJava and Retrofit2 and wondering if there is any case that the return type of a Web API has to be an Observable and can not be a Single.
As far as I can think of ... even paged datas ...
0
votes
1
answer
48
views
How to trigger recomposition when observing LiveData
I'm migrating an app from views to compose and am trying to trigger a schedule update every five minutes in which if there is a change in the data compose should recompose. Still using RxJava in my ...
0
votes
1
answer
25
views
Getting Compilation Failure "cannot find symbol for concatMap" in the RxJava Code
I am new to this RxJava coding language.
I am trying to write a function that recursively copies files from one S3 location and pastes the content to another S3 location.
Here is the code that I have ...
0
votes
1
answer
351
views
IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet
Assume simplfied class like:
class MyModel() {
companion object
val number = mutableStateOf(0)
init {
refresh()
}
fun refresh() {
RestClient.getNumber()
...
0
votes
0
answers
31
views
RxJava Scheduler scheduleDirect guarantees
If I have some code like the following:
Schedulers.single().scheduleDirect {
Schedulers.single().scheduleDirect {
println("Run inner code") // Line A
}
println("...
2
votes
0
answers
27
views
Where do I put the Disposable for RxJava?
I'm using RxJava2 and subscribing to my data streams with a CompositeDisposable variable. I'm familiar with codebases having the disposable in the Fragment/Activity, but I'm not entirely sure why that ...
1
vote
1
answer
45
views
RxJava PublishSubject buffer elements with timeout
I want to achieve the following with RxJava:
Buffer elements and publish them when 5 seconds passed after the last element
Publish buffered elements in 20 seconds passed after the first element
...
0
votes
1
answer
21
views
adjust delay value in rx java from source
I'm new to Rxjava and could not find an example or appropriate usage of single.delay() that uses the result of the previous flatmap as the delay. My aim is to use the result of functionOne() to set ...
0
votes
0
answers
30
views
Does the Observable.take(1) function dispose itself after taking 1?
Does an Observable.take(1) function dispose itself after taking 1?
0
votes
1
answer
33
views
retryWhen hanging after migrating from rxjava to rxjava2
We have the following methods which we have recently migrated from rx-java to rx-java2:
@Override
public Observable<FooResponse> doFoo(String id) {
return api.doFoo(id)
.map(Response::...
0
votes
1
answer
28
views
How to update the first observable with the data of the second dependent on the first
In Android using Retrofit combined with RxJava I get an object Observable. Inside I have a List; inside Table I have properties containing a foreign key from the object Product.
My goal is to get the ...
0
votes
0
answers
54
views
Reduce response time
The operation api.getProducts(..) with the help of Retrofit, we invoke a GET from another API. Now, repeatUntil() is used since the other API returns a page and there is a specific documentId that has ...
0
votes
0
answers
65
views
RxJava2 onNext can't execute after FlowableEmitter.onNext executed many times
I called the Flowable.create to implement that loop read data from bluetooth sockete InputStream, I try the below pseudocode to implement this.
// connectBluetoothFlowable is a Flowable<Boolean>
...
0
votes
0
answers
40
views
Android: NPE: Observable.takeLast
I set up some observables like so
companion object {
var isLocationToolActive: BehaviorSubject<Boolean> = BehaviorSubject.createDefault(false)
var isAoIToolActive: ...