org.atmosphere.samples.pubsub
Class AsynchronousAnnotation
java.lang.Object
org.atmosphere.samples.pubsub.AsynchronousAnnotation
public class AsynchronousAnnotation
- extends Object
Simple Asynchronous sample that demonstrate how task can be asynchronously executed. This class support all protocol
and use the HeaderConfig to create a single Broadcaster
associated with the remote client.
- Author:
- Jeanfrancois Arcand
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsynchronousAnnotation
public AsynchronousAnnotation()
subscribe
@Asynchronous
public String subscribe()
- Suspend the connection, wait for a broadcast events.
- Returns:
publish
@Asynchronous
public Callable<String> publish(String message)
- Asynchronously return a String.
- Parameters:
message - a message sent by the client.
- Returns:
- a Callable that will resume the suspended connection if long-polling/jsonp is used, or keep-alive the
connection for websocket and http streaming.
Copyright © 2012. All Rights Reserved.