functional reactive programming, particularly rxjava2 in this post, is really fun when get accustomed to but getting familiar and thinking in reactive way is a little hard as first days.
anyway, after several days of reading then I have implemented this style in one of my commercial projects. this paradigm save us lots of hardware resource also happy customers who apply our interface which observe the events triggered by this apply
by customer.
honestly speaking, due to well designed implementations, we have not faced any threshold issue but to be ready those issues beforehand, I started curious about thread pools and management.
observeon and subscribeon are two ways to manage these thread pool either self constructed by Schedulers.from() or one of prebuild Schedulers in the framework.
real reason I want to deeply analyse this is, names of those two operations are misleading at first interaction. not sure they will come true for me when I work more with Rx frameworks.
I thought calling subscribeon is a relation with consuming the events, as name implies for me, but it vise-versa. its actually threads being used while emitting.
below 4 small java code pieces and logs accompanying to them are self describing.
pls pay attenting how create and flatmap operations are being run. and how rest of the operations are.
and also how blockingSubscribe effects the behavior, and overwriting the observeOn operation.
Also I am really curious about, am i the only one thinking that those operation name must be changed with each other?
source code for this tests can be found in this git project
anyway, after several days of reading then I have implemented this style in one of my commercial projects. this paradigm save us lots of hardware resource also happy customers who apply our interface which observe the events triggered by this apply
by customer.
honestly speaking, due to well designed implementations, we have not faced any threshold issue but to be ready those issues beforehand, I started curious about thread pools and management.
observeon and subscribeon are two ways to manage these thread pool either self constructed by Schedulers.from() or one of prebuild Schedulers in the framework.
real reason I want to deeply analyse this is, names of those two operations are misleading at first interaction. not sure they will come true for me when I work more with Rx frameworks.
I thought calling subscribeon is a relation with consuming the events, as name implies for me, but it vise-versa. its actually threads being used while emitting.
below 4 small java code pieces and logs accompanying to them are self describing.
pls pay attenting how create and flatmap operations are being run. and how rest of the operations are.
and also how blockingSubscribe effects the behavior, and overwriting the observeOn operation.
Also I am really curious about, am i the only one thinking that those operation name must be changed with each other?
source code for this tests can be found in this git project
Yorumlar
Yorum Gönder