public class MobileEventStream extends Object implements AutoCloseable
try (MobileEventStream stream = new MobileEventStream(...)) {
stream.connect(...);
stream.consume(...);
}
| Modifier and Type | Field and Description |
|---|---|
static String |
X_UA_APPKEY |
| Constructor and Description |
|---|
MobileEventStream(StreamQueryDescriptor descriptor,
com.ning.http.client.AsyncHttpClient client,
Consumer<String> eventConsumer,
String url,
FatalExceptionHandler fatalExceptionHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect(long maxConnectWaitTime,
TimeUnit unit) |
void |
consume(long maxConsumeTime,
TimeUnit unit) |
public static final String X_UA_APPKEY
public MobileEventStream(StreamQueryDescriptor descriptor, com.ning.http.client.AsyncHttpClient client, Consumer<String> eventConsumer, String url, FatalExceptionHandler fatalExceptionHandler)
public void connect(long maxConnectWaitTime,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic void consume(long maxConsumeTime,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2016. All rights reserved.