Skip to content

juxt/flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flow

Flow is a Clojure library that provides Clojure protocols which closely match with the Java interfaces defined by Reactive Streams and standardised as java.util.concurrent.Flow in JDK 9 and above.

This interface provides a common standard allowing JUXT libraries to integrate data streams with back-pressure, and interoperate with other libraries that support the Reactive Streams standard, such as RxJava.

Why not just use Reactive Streams JVM interfaces?

The JVM interfaces created by Reactive Streams (Processor, Publisher, Subscriber, Subscription) are published in the org.reactivestreams package and in the Java 9 JDK itself, wrapped in the java.util.concurrent.Flow class.

Eventually, all compatible JVM libraries are expected to upgrade to the JDK 9 interfaces. However, while Java 8 is still in use, Clojure protocols can be used to adapt between these Java interfaces and the various library classes that implement them, allowing a mix of 'old' and 'new' implementations.

Status

Flow is ALPHA status, meaning that changes are expected.

Relationship to other Clojure libraries

Manifold

Flow plays a similar role to Manifold. Both are written to simplify programming with asynchronous IO with back-pressure.

Ring

Flow is loosely related to Ring 2.1

(T)he plan is to have NIO protocols that the request body and response body can optionally satisfy.

Flow is proposed for consideration as a candidate for these NIO protocols, which if accepted, would mean the juxt.flow namespace prefix could be replaced with one in the ring namespace hierarchy.

Flux

Flux is a Ring adapter for Vert.x.

The aim is to provide working code examples to demonstrate the sufficiency of Flow’s protocols in implementing various use-cases of async non-blocking IO with back-pressure using Ring, including streaming request and response bodies, websockets and server-sent events.

License

The MIT License (MIT)

Copyright © 2020 JUXT LTD.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published