com.github.eventsource.client
Class EventSource
java.lang.Object
com.github.eventsource.client.EventSource
public class EventSource
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_RECONNECTION_TIME_MILLIS
public static final long DEFAULT_RECONNECTION_TIME_MILLIS
- See Also:
- Constant Field Values
EventSource
public EventSource(Executor executor,
long reconnectionTimeMillis,
URI uri,
EventSourceClientHandler eventSourceHandler)
- Creates a new EventSource client. The client will reconnect on
lost connections automatically, unless the connection is closed explicitly by a call to
close().
For sample usage, see examples at GitHub.
- Parameters:
executor - the executor that will receive eventsreconnectionTimeMillis - delay before a reconnect is made - in the event of a lost connectionuri - where to connecteventSourceHandler - receives events- See Also:
close()
EventSource
public EventSource(URI uri,
EventSourceClientHandler eventSourceHandler)
connect
public org.jboss.netty.channel.ChannelFuture connect()
close
public EventSource close()
- Close the connection
- Returns:
- self
join
public EventSource join()
throws InterruptedException
- Wait until the connection is closed
- Returns:
- self
- Throws:
InterruptedException - if waiting was interrupted
Copyright © 2011. All Rights Reserved.