Reactive Programming on Android with RxJava


Marble diagram of .skip()



Download 1,47 Mb.
Pdf ko'rish
bet29/60
Sana20.04.2022
Hajmi1,47 Mb.
#566724
1   ...   25   26   27   28   29   30   31   32   ...   60
Bog'liq
reactiveandroid

Marble diagram of .skip()
Take
Mirroring
.skip()
,
.take(n)
takes the first
n
items emitted by the sequence and completes
immediately after. Similarly,
.take(time, timeUnit)
only takes the item/s emitted in the specified
time window and ignores the rest.
Marble diagram of .take()
First & Last
.first()
&
.last()
are pretty self-explanatory. Note, however, that these methods return a
Single
rather than an
Observable
. A
Single
is a special subset of an
Observable
that emits just a single


Chapter 3: Operators
34
item rather than a sequence of items. It contains a subset of the
Operator
s that an
Observable
given
its nature. We will look over
Single
in more detail in
Chapter 5: Completable, Single, and Maybe
Marble diagram of .first()
Marble diagram of .last()
Notice for
.last()
that the item is not received immediately after it is emitted, it is received only
after the upstream sequence completes.
Combining
Oftentimes you may find the need to combine several
Observable
streams into a single stream.
Perhaps you have independent streams coming from multiple different sources and you would like to


Chapter 3: Operators
35
combine the results of these. Traditionally in Java, this task is especially difficult since synchronizing
and blocking to wait on data coming from different threads of execution is error-prone and hard to
debug. With RxJava, there are a few handy
Operator
s that allow you to combine several streams
into a single unified stream.
Merge & Concat
There are several overloaded flavors of the
.merge() Operator
, all of which allow
merging
of
multiple
Observable
streams into a single stream.

Download 1,47 Mb.

Do'stlaringiz bilan baham:
1   ...   25   26   27   28   29   30   31   32   ...   60




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish