reactive-programming Questions
2
Solved
Consider the following code:
CurrentValueSubject<Void, Error>(())
.eraseToAnyPublisher()
.sink { completion in
switch completion {
case .failure(let error):
print(error)
print("F...
Blamable asked 24/9, 2021 at 7:46
2
Solved
I'm working on a Spring webflux project and I want to understand the difference between throwing an exception vs using Mono.error().
If there is a validation class like this for example:
public cl...
Huei asked 14/9, 2021 at 13:39
2
Solved
I'm creating simple controller server for spring reactive project. While setting redirection to another location, I have found an error when calling http://localhost:8080/:
There was an unexpected...
Massimo asked 9/9, 2019 at 12:0
10
Solved
I was going through this blog and reading about Observables and couldn't figure out the difference between the Observable and a Subject.
Woodie asked 28/11, 2017 at 17:50
3
Solved
As far as I understand, following are the techniques to solve asynchronous programming workflows:
Callbacks (CSP)
Promises
Newer approaches:
Rx.js Observables (or mostjs, bacon.js, xstream et...
Wordsmith asked 27/12, 2016 at 16:52
7
In the documentation for RetryWhen the example there goes like this:
Observable.create((Subscriber<? super String> s) -> {
System.out.println("subscribing");
s.onError(new RuntimeExcep...
Maeda asked 16/6, 2016 at 13:33
5
Solved
I'm working with the latest Angular and Typescript and RxJS 5.
Angular has currently made RxJS a necessity. I've used C# primarily for over 10 years and I'm very much used to Linq/Lambdas/fluent s...
Clambake asked 26/1, 2017 at 11:42
1
Solved
In the below two examples, the behavior of processing a flux stream seems to be different.
Example 1 :
public static void main(String[] args) throws InterruptedException {
log.debug(" Before ...
Digitigrade asked 9/7, 2021 at 16:46
5
How to handle network failure in React-Native, when device not connected to network.
My scenario is am trying to connect some api, while fetching request if network is disconnected react-native th...
Constrict asked 28/4, 2016 at 23:14
0
Is it possible to perform MongoDB bulk operations (like update/upsert) using ReactiveMongoTemplate or spring-data-mongodb-reactive?
Kaon asked 3/6, 2021 at 23:30
2
Solved
Recently, in my Angular app, I've started to use the rxjs switchMap operator in a couple of different scenarios. I soon realised that when using switchMap, when you subscribe to this stream, the co...
Rideout asked 31/10, 2017 at 9:27
8
Solved
In my app i have something like:
this._personService.getName(id)
.concat(this._documentService.getDocument())
.subscribe((response) => {
console.log(response)
this.showForm()
});
//Outpu...
Mojgan asked 16/5, 2017 at 14:22
2
RxJava has a method toSortedList(Comparator comparator) that converts a flow of objects into a list of objects sorted by a Comparator.
How can I achieve the same in JavaScript with RxJS and get an...
Mcsweeney asked 22/10, 2015 at 9:55
2
Solved
I am slightly confused to get the proper response when the user tries to use two rest endpoints with WebClient. I want to use it as asynchronous and non-blocking in the code.
I am returning the Flu...
Agulhas asked 23/5, 2021 at 14:13
0
In recent reactor version WorkQueueProcessor got deprecated and set to be removed at version 3.5.
With the new Sinks spec, I'm wondering is there an alternative for WorkQueueProcessor? I'm looking ...
Hydrosphere asked 18/5, 2021 at 9:13
3
Solved
I have created an observable that consists of an item being transformed to another by running an async method.
IObservable<Summary> obs = scanner.Scans
.SelectMany(b => GetAssignment(b))
...
Dewie asked 13/5, 2021 at 11:18
1
Solved
I'm a beginner of spring webflux. While researching I found some code like:
Mono result = someMethodThatReturnMono().cache();
The name "cache" tell me about caching something, but where ...
Feldt asked 11/5, 2021 at 12:47
2
Solved
CompletableFuture executes a task on a separate thread ( uses a thread-pool ) and provides a callback function. Let's say I have an API call in a CompletableFuture. Is that an API call blocking? Wo...
Firearm asked 25/2, 2019 at 12:37
4
Solved
When I create an observable from scratch, and have the observer error, then complete, the done part of the subscription never is invoked.
var observer = Rx.Observable.create(function(observer){
o...
Scorn asked 18/11, 2015 at 15:26
1
Solved
While working with Spring 5 reactive APIs , i came across the deprecated MediaType APPLICATION_STREAM_JSON_VALUE , which when used display values from a GET REST endpoint in a stream kind of fashio...
Caelian asked 13/3, 2021 at 13:21
1
Solved
I am currently on a Project that builds Microservices, and are trying to move from the more traditional Spring Boot RestClient to Reactive Stack using Netty and WebClient as the HTTP Client in orde...
Bullfrog asked 6/3, 2021 at 13:7
7
Solved
I have a method which accepts Mono as a param.
All I want is to get the actual String from it. Googled but didn't find answer except calling block() over Mono object but it will make a blocking cal...
Terresaterrestrial asked 8/11, 2017 at 12:37
2
Solved
Recently I noticed that my team follows two approaches on how to write tests in Reactor. First one is with help of .block() method. And it looks something like that:
@Test
void set_entity_version()...
Stoop asked 2/7, 2020 at 13:10
2
Solved
I have two methods.
Main method:
@PostMapping("/login")
public Mono<ResponseEntity<ApiResponseLogin>> loginUser(@RequestBody final LoginUser loginUser) {
return socialService...
Faugh asked 25/1, 2019 at 23:0
6
I am using RxJava2 in my android project.
I am using the following code to create the Observable
public Observable<AlbumDetails> loadAlbumFromAlbumId(final String albumId) {
return Observ...
Inquiline asked 3/5, 2017 at 17:59
© 2022 - 2024 — McMap. All rights reserved.