public final class ContinuousChangesFeed extends Object implements ChangesFeed, Runnable
| Constructor and Description |
|---|
ContinuousChangesFeed(String dbName,
HttpResponse httpResponse) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Will close this feed and interrupt any threads waiting on next()
|
boolean |
isAlive() |
DocumentChange |
next()
Retrieves and removes the head of this changes feed, waiting if necessary until an element becomes available.
|
DocumentChange |
next(long timeout,
TimeUnit unit)
Retrieves and removes the head of this changes feed, waiting up to the specified wait time if necessary for an element to become available.
|
DocumentChange |
poll()
Retrieves and removes the head of this changes feed, do not wait until an element becomes available. returns null if empty
|
int |
queueSize() |
void |
run() |
public ContinuousChangesFeed(String dbName, HttpResponse httpResponse)
public DocumentChange next() throws InterruptedException
ChangesFeednext in interface ChangesFeedInterruptedException - when this changes feed is closed or otherwise is interruptedpublic DocumentChange poll() throws InterruptedException
ChangesFeedpoll in interface ChangesFeedInterruptedException - when this changes feed is closed or otherwise is interruptedpublic DocumentChange next(long timeout, TimeUnit unit) throws InterruptedException
ChangesFeednext in interface ChangesFeedInterruptedException - when this changes feed is closed or otherwise is interruptedpublic void cancel()
ChangesFeedcancel in interface ChangesFeedpublic boolean isAlive()
isAlive in interface ChangesFeedpublic int queueSize()
queueSize in interface ChangesFeedCopyright © 2013. All Rights Reserved.