Use of Transformer in RxJava

Transformer purpose Transformer, as the name suggests, means converter. As early as rxjava 1 The X version has Observable Transformer,Single.Transformer and complete Transformer, in 2 In version x, it becomes Observable transformer, SingleTransformer, completable transformer, Flowable transformer and maybtransformer. Among them, FlowableTransf ...

Added by sd9sd on Mon, 21 Feb 2022 17:49:20 +0200

rxjava2 source code analysis and thread switching analysis

usage method Let's start with the most basic use: Observable.create(new ObservableOnSubscribe<String>() { @Override public void subscribe(ObservableEmitter<String> emitter) throws Exception { emitter.onNext("1"); emitter.onNext("2"); emitter.onNext("3" ...

Added by harryman100 on Sat, 19 Feb 2022 17:41:20 +0200

Java tips: use RxJava to create observable data RxLiveData

1. Problem scenario In practical work, we often need to share data between different objects and different modules, and these data are usually changeable, so a problem may occur: when the data changes, the relevant objects or modules do not know and do not update the data in time. At this time, we hope to notify other modules to update synchro ...

Added by God Ownz on Sun, 30 Jan 2022 10:59:04 +0200

The core principle of spring cloud RPC: RxJava responsive programming framework, creation operator

Create type operator The creation operator is used to create an Observable object, Observable subject object and pop up data. RxJava has many creation operators, which are roughly as follows: (1) Create (): create an Observable topic object from scratch using the function. (2) defer(): Observable topic objects are created only when subscribe ...

Added by rossh on Sun, 23 Jan 2022 09:04:58 +0200

Kill RxJava series -- 2 Handwritten FlowBus replaces RxBus/EventBus/LiveDataBus

Lack of LiveData LiveData is an observable data storage class dedicated to Android with autonomous life cycle awareness. It is deliberately simplified in design, which makes it easy for developers to start, but its shortcomings are as follows: LiveData can only update data in the main thread (the underlying layer of postValue is also switched ...

Added by rednax on Fri, 31 Dec 2021 11:29:45 +0200

Rxjava source code analysis - thread switching source code

summary The source code of rxjava simple subscribe has been mentioned earlier. Interested readers can have a look. Rxjava source code analysis (I) - subscribe source code Based on the previous analysis, this article will continue to talk about rxjava interrupt thread switching. Demo The main logic is as follows: Observable calls create() t ...

Added by itreP on Wed, 22 Dec 2021 14:12:24 +0200