Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.12 KB

README.md

File metadata and controls

82 lines (61 loc) · 2.12 KB

Welcome to the Atmosph4rX Framework!

The WebSocket Reactive Streams Framework for Java

SpringBoot 2 + Project Reactor + Atmosphere = Atmosph4rX.

Reactive Streams made easy!

Atmosph4rX is a complete rewrite of the Atmosphere Framework. All the functionalities are or will be ported to Atmosph4rX.

ROADMAP

  • Work in Progress. See ROADMAP for more details.

As simple as

Reactive Streams Subscriber

       @ReactTo("/mySubscriber")
       public final class MySubscriber implements AxSubscriber<String> {
   
           @Topic("/message")
           private SocketsGroupProcessor<String> processor;
   
           @Override
           public void onSubscribe(AxSubscription s) {
               processor.subscribe(s.socket());
           }
   
           @Override
           public void onNext(String next) {
                // Push data to all {@link Subscriber}s.  
                // toProcessor return a FluxProcessor
                processor.toProcessor().onNext(next);
           }
   
           @Override
           public void onComplete() {
           }
   
           @Override
           public void onError(Throwable throwable) {
           }
   
       }

Annotation based

       @ReactTo("/foo")
       public final class MyPoJo {
   
           @Topic("/message")
           private SocketsGroupProcessor<String> processor;
   
           @Open
           public void open() {
           }
        
           @Close
           public void close() {
           }
        
           @Message
           public void on(String message) {
              processor.publish(next);
           }
        
           @Error
           public void error() {
           }         
   
       }

How to install

     <dependency>
         <groupId>org.atmosphere</groupId>
         <artifactId>atmosph4rx</artifactId>
         <version>4.0.0-SNAPSHOT</version>
      </dependency>