Java 9 Flow API – Reactive Streams
java9
6
flow
1
reactive
1
streams
1
Male avatar

loveprogramming viết ngày 16/04/2021

https://grokonez.com/java/java-9/java-9-flow-api-reactive-streams

Java 9 Flow API – Reactive Streams

Java 9 introduces Reactive Streams under java.util.concurrent.Flow that supports an interoperable publish-subscribe framework. In the tutorial, we're gonna look at a general view of Reactive Streams and how it comes to Java 9 with some new Flow API Components.

Related Articles:

I. Reactive Streams

1. Overview

Reactive Streams aims to improve concurrency workflows for developers by solving the pain of back-pressure (when fast data source doesn't overwhelm the stream destination).

reactive-stream-backpressure

In the image above, we can see that if Destination can not deal with incoming data from Source, all future data could be blocked until the existing ones are processed.

If the Source checks when Destination is not overflowed to send data, the problem could be solved. But in this case, it is still synchronous communication and we don't take advantage of an asynchronous system which enables the parallel use of computing resources, on collaborating network hosts or multi-core processor.

Reactive Streams processes an asynchronous stream data across an asynchronous boundary (passing elements on to another thread or thread-pool), and receiving side (Destination) is not forced to buffer arbitrary amounts of data, then buffer overflow will not occur.

In summary, Reactive Streams:

  • process a potentially unbounded number of elements
  • in sequence,
  • asynchronously passing elements between components,
  • with mandatory non-blocking back-pressure.

These things are possible by flow control and the publish-subscribe pattern which allows the subscriber to be able to understand limitation and show publisher its capacity.

More at:

https://grokonez.com/java/java-9/java-9-flow-api-reactive-streams

Java 9 Flow API – Reactive Streams

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

451 bài viết.
79 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 6 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 5 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 5 tháng trước
1 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
451 bài viết.
79 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!