public class GHNotificationStream extends Object implements Iterable<GHThread>
This class supports two modes of retrieving notifications that can
be controlled via nonBlocking(boolean).
In the blocking mode, which is the default, iterator will be infinite.
The call to Iterator.next() will block until a new notification
arrives. This is useful for application that runs perpetually and reacts
to notifications.
In the non-blocking mode, the iterator will only report the set of notifications initially retrieved from GitHub, then quit. This is useful for a batch application to process the current set of notifications.
GitHub.listNotifications(),
GHRepository.listNotifications()| Modifier and Type | Method and Description |
|---|---|
Iterator<GHThread> |
iterator()
|
void |
markAsRead() |
void |
markAsRead(long timestamp)
Marks all the notifications as read.
|
GHNotificationStream |
nonBlocking(boolean v)
If set to true,
iterator() will stop iterating instead of blocking and
waiting for the updates to arrive. |
GHNotificationStream |
participating(boolean v)
Should the stream be restricted to notifications in which the user
is directly participating or mentioned?
|
GHNotificationStream |
read(boolean v)
Should the stream include notifications that are already read?
|
GHNotificationStream |
since(Date dt) |
GHNotificationStream |
since(long timestamp) |
public GHNotificationStream read(boolean v)
public GHNotificationStream participating(boolean v)
public GHNotificationStream since(long timestamp)
public GHNotificationStream since(Date dt)
public GHNotificationStream nonBlocking(boolean v)
iterator() will stop iterating instead of blocking and
waiting for the updates to arrive.public void markAsRead()
throws IOException
IOExceptionpublic void markAsRead(long timestamp)
throws IOException
IOExceptionCopyright © 2015. All Rights Reserved.