28 Exercise Using flatMap and distinct operators (Reactive programming with Java - full course)

  Рет қаралды 17,567

Java Brains

Java Brains

Жыл бұрын

Course: Reactive programming in Java
Covers: Reactive fundamentals, Project Reactor
Access this full course NOW & unlock more awesome courses like this by becoming a member:
/ @java.brains
Website:
www.javabrains.io
Learn the basics of reactive programming. You will learn to "THINK REACTIVE" - understand the paradigm shift and thinking change necessary to write code in a reactive way using Project Reactor.
New video every 3 days! Subscribe and enable notifications to be alerted.

Пікірлер: 11
@MrSATYAMJOSHI
@MrSATYAMJOSHI Жыл бұрын
Thank you Kaushik. If anyone is interested, "Spring in Action" is one of the books that explains Java Reactive programming in detail.
@alanmangroo3656
@alanmangroo3656 Жыл бұрын
Great video. Thanks!
@arnav_gaur
@arnav_gaur Жыл бұрын
Thanks Kaushik for the awesome content! I binge watched the playlist. Eagerly waiting for rest of the videos :)
@mostinho7
@mostinho7 Жыл бұрын
Done thanks Calling subscribe is what starts the flux stream, if you don’t call subscribe then it won’t get triggered even if you perform operations on the flux stream .distinct() operator eliminates repeated values from flux stream .distinctUntilChanged() will remove repeated values in a row like 1,1 but will not remove repeated values if they changed in between Project reactor has operators documentation to find out how each one works to transform the stream and if it is blocking or async
@shivask5543
@shivask5543 Жыл бұрын
👌!! Thanks!!
@manamohansamal1040
@manamohansamal1040 Жыл бұрын
For mapping int to its related user we are doing a filter inside a map of the first flux, so isn't that a blocking operation as the id need to wait for the user flux to complete until check for the last element complete the filter operation?
@adambickford8720
@adambickford8720 Жыл бұрын
.flatMap is inherently async, it's not returning the user it's returning yet another publisher (Flux) that will eventually publish 1 user (due to the take(1)) on subscribe. FlatMap is so you don't end up with Flux which is awkward "in the future i'll give you another promise about the future" so skip the middleman and go to the last promise.
@manamohansamal1040
@manamohansamal1040 Жыл бұрын
@@adambickford8720 yes its returning flux of flux but that doesn't guarantee to be a async process, a flux can be a sync process also.
@adambickford8720
@adambickford8720 Жыл бұрын
@@manamohansamal1040 yes, you can break any contract (though a good runtime will actually prevent you from blocking). But the API is there to support async, which is what he's demonstrating. You also don't check for the last element, you eval each one and it short circuits after 1 hit in this case. It could literally be the first element.
@mrrishiraj88
@mrrishiraj88 Жыл бұрын
Good day greetings
@dadylle
@dadylle Жыл бұрын
Subscribe is the contract between the source and the consumer, when data is ready the source push data to observers how are in there subscriber's list, maybe at the time of subscribing there is no data.
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 7 МЛН
Они убрались очень быстро!
00:40
Аришнев
Рет қаралды 3 МЛН
Java Stream Flatmap : Learn Java Streams Flatmap vs Map
13:40
Shane Crouch
Рет қаралды 6 М.
Spring Annotations for Experienced Developers #springboot #java
10:51
Streams. Метод flatMap(прокачанная Java)
8:05
Програмания
Рет қаралды 7 М.
STOP Learning These Programming Languages (for Beginners)
5:25
Andy Sterkowitz
Рет қаралды 647 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 599 М.
flatMap with Flux in Project Reactor
12:14
Muhammed Shakir
Рет қаралды 6 М.
Is this unfair?
16:04
Java Brains
Рет қаралды 11 М.