Skip to content

Server Side Broadcasts OR Communication from Server Sides OR Non Http initiated Broadcast

Jeanfrancois Arcand edited this page Jan 20, 2015 · 2 revisions

Once an AtmosphereResource gets suspended, you can initiate server push (or broadcast) at any moment. For example, the following code will broadcast every 10 seconds to all AtmosphereResource associated with the /* broadcaster:

       @Inject BroadcasterFactory factory;


       // Broadcaster periodically
        factory.lookup("/*").scheduleFixedBroadcast(
          new Callable<String>() {
            private int count =0;
            @Override
            public String call() throws Exception {
                return " Server Push " + count++;
            }
        }, 10, TimeUnit.SECONDS)

See on how to get the BroadcasterFactory

Step by Step Tutorials

Concepts & Architecture

15 Minutes Tutorial

Advanced Topics

API

Known WebServer Issues

References

External Documentations

githalytics.com alpha

Clone this wiki locally