Java 9で導入される予定のReactive Streams向けのpublish-subscribeフレームワーク。
エンドユーザが直接利用するAPIではなく、非同期処理ライブラリ相互運用のための共通インタフェースを規定する。(これ自体が特定の機能提供するわけではない)
JEP 266: More Concurrency Updates
Summary
An interoperable publish-subscribe framework, enhancements to the CompletableFuture API, and various other improvements.
[...]
Description
- Interfaces supporting the Reactive Streams publish-subscribe framework, nested within the new class
Flow
, along with a utility classSubmissionPublisher
that developers can use to create custom components. These (very small) interfaces correspond to those defined with broad participation (from the Reactive Streams initiative) and support interoperability across a number of async systems running on JVMs. Nesting the interfaces within a class is a conservative policy allowing their use across various short-term and long-term possibilities. The proposedjava.util.concurrent
components have been offered in pre-release since January 2015, and have benefitted from several rounds of review. There are no plans to provide network- or I/O-basedjava.util.concurrent
components for distributed messaging, but it is possible that future JDK releases will include such APIs in other packages.
仕様
Reactive Streams Specification for the JVM
The Reactive Streams specification consists of the following parts:
The API specifies the types to implement Reactive Streams and achieve interoperability between different implementations.
The Technology Compatibility Kit (TCK) is a standard test suite for conformance testing of implementations.
API
- インタフェース
Flow.Publisher<T>
Flow.Subscriber<T>
-
Flow.Processor<T>
(extendsFlow.Publisher<T>
,Flow.Subscriber<T>
) Flow.Subscription
- クラス
-
SubmissionPublisher
(implementsFlow.Publisher<T>
)