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

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

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.
@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
@alanmangroo3656
@alanmangroo3656 Жыл бұрын
Great video. Thanks!
@shivask5543
@shivask5543 Жыл бұрын
👌!! Thanks!!
@mrrishiraj88
@mrrishiraj88 Жыл бұрын
Good day greetings
@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.
@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.
Java Stream Flatmap : Learn Java Streams Flatmap vs Map
13:40
Shane Crouch
Рет қаралды 6 М.
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 52 МЛН
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 205 М.
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 3,6 МЛН
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 54 МЛН
Streams. Метод flatMap(прокачанная Java)
8:05
Програмания
Рет қаралды 7 М.
STOP Learning These Programming Languages (for Beginners)
5:25
Andy Sterkowitz
Рет қаралды 651 М.
Spring Boot Reactive Programming Webflux map vs flatMap, log and filter Flux
13:27
🔔 Top 5 mistakes with Java Sets!
17:58
Java Brains
Рет қаралды 25 М.
Learn To Code Like a GENIUS and Not Waste Time
9:41
The Coding Sloth
Рет қаралды 1,2 МЛН
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 52 МЛН