Skip to content

Atmosphere/Atmosph4rX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>