thabach / Atmosph4rX

Atmosphere Framework version 4 for Reactive Streams

Home Page:http://async-io.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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>

About

Atmosphere Framework version 4 for Reactive Streams

http://async-io.org

License:Apache License 2.0


Languages

Language:Java 100.0%