DT: Dynamically change column values based on selectinput from another column in R shiny app

I’d suggest using dataTableProxy along with replaceData to realize the desired behaviour. This is faster than re-rendering the datatable. Furthermore, re-rendering the table seems to be messing around with the bindings of the selectInputs. Also please note: for this to work I needed to switch to server = TRUE library(DT) library(shiny) selectInputIDs <- paste0(“sel”, 1:10) … Read more

How to ‘wait’ for two observables in RxJS

Last Update: Mar, 2022. RxJS v7: combineLatestWith From reactiveX documentation: Whenever any input Observable emits a value, it computes a formula using the latest values from all the inputs, then emits the output of that formula. // Observables to combine const name$ = this._personService.getName(id); const document$ = this._documentService.getDocument(); name$.pipe( combineLatestWith($document) ) .subscribe(([name, document]) => { … Read more

What is the difference between Observable and a Subject in rxjs?

In stream programming there are two main interfaces: Observable and Observer. Observable is for the consumer, it can be transformed and subscribed: observable.map(x => …).filter(x => …).subscribe(x => …) Observer is the interface which is used to feed an observable source: observer.next(newItem) We can create new Observable with an Observer: var observable = Observable.create(observer => … Read more

block()/blockFirst()/blockLast() are blocking error when calling bodyToMono AFTER exchange()

First, a few things that will help you understand the code snippet solving this use case. You should never call a blocking method within a method that returns a reactive type; you will block one of the few threads of your application and it is very bad for the application Anyway as of Reactor 3.2, … Read more

What is the difference between flatmap and switchmap in RxJava?

According to the documentation ( http://reactivex.io/documentation/operators/flatmap.html ) the switchMap is like the flatMap, but it will only emit items from the new observable until a new event is emitted from the source observable. The marble diagram shows it well. Notice the difference in the diagrams: In switchMap the second original emission (green marble) does not … Read more

How to get String from Mono in reactive java

Getting a String from a Mono<String> without a blocking call isn’t easy, it’s impossible. By definition. If the String isn’t available yet (which Mono<String> allows), you can’t get it except by waiting until it comes in and that’s exactly what blocking is. Instead of “getting a String” you subscribe to the Mono and the Subscriber … Read more

Spring 5 WebClient using ssl

See example of use insecure TrustManagerFactory that trusts all X.509 certificates (including self-signed) without any verification. The important note from documentation: Never use this TrustManagerFactory in production. It is purely for testing purposes, and thus it is very insecure. @Bean public WebClient createWebClient() throws SSLException { SslContext sslContext = SslContextBuilder .forClient() .trustManager(InsecureTrustManagerFactory.INSTANCE) .build(); ClientHttpConnector httpConnector … Read more

What’s the point of .switchIfEmpty() getting evaluated eagerly?

What you need to understand here is the difference between assembly time and subscription time. Assembly time is when you create your pipeline by building the operator chain. At this point your publisher is not subscribed yet and you need to think kind of imperatively. Subscription time is when you trigger the execution by subscribing … Read more