Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Blocking the Event Loop

Front

When transitioning from Spring MVC to WebFlux, what must be avoided?

Avoid using blocking code or synchronous APIs. Transitioning to WebFlux requires avoiding blocking calls to leverage its non-blocking…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

Why is backpressure important in Reactive Streams?

It prevents data overflow by controlling the flow rate. Backpressure allows a system to handle data at a…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

Why is map preferred for simple transformations in reactive streams?

Because it keeps the flow structure unchanged. The 'map' function is used for straightforward transformations that don't alter…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

How does WebFlux compare to using Virtual Threads?

WebFlux uses non-blocking IO, while Virtual Threads simulate concurrency with blocking IO. WebFlux is designed for non-blocking, asynchronous…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

Why does the 'Subscriber' interface in Reactive Streams matter in this design?

The Subscriber receives data and signals demand. The 'Subscriber' interface listens to a 'Publisher' for data, processing each…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

What happens if a blocking operation occurs inside a WebFlux handler?

It can freeze the event loop, causing a system bottleneck. Blocking operations inside a WebFlux handler can stall…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

How do 'map' and 'flatMap' differ in reactive streams?

'map' transforms data; 'flatMap' transforms data into a new Publisher. In reactive streams, 'map' is used for one-to-one…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

Why is it critical to use non-blocking database drivers in WebFlux?

Blocking drivers can halt the event loop, reducing performance and scalability. Traditional JDBC drivers block the thread until…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

What does the 'request(n)' method do in Reactive Streams?

It signals how many items the Subscriber is ready to process. In Reactive Streams, backpressure is essential for…

View Card →
Flashcard Study

Java: Blocking the Event Loop

Front

How does a non-blocking event loop improve scalability?

Non-blocking event loops allow handling many concurrent requests with fewer resources. A non-blocking event loop can process multiple…

View Card →