java.lang.Object
org.kohsuke.github.GHNotificationStream
Listens to GitHub notification stream.
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.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioniterator()
void
Mark as read.void
markAsRead
(long timestamp) Marks all the notifications as read.nonBlocking
(boolean v) If set to true,iterator()
will stop iterating instead of blocking and waiting for the updates to arrive.participating
(boolean v) Should the stream be restricted to notifications in which the user is directly participating or mentioned?.read
(boolean v) Should the stream include notifications that are already read?.since
(long timestamp) Since gh notification stream.Since gh notification stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
read
Should the stream include notifications that are already read?.- Parameters:
v
- the v- Returns:
- the gh notification stream
-
participating
Should the stream be restricted to notifications in which the user is directly participating or mentioned?.- Parameters:
v
- the v- Returns:
- the gh notification stream
-
since
Since gh notification stream.- Parameters:
timestamp
- the timestamp- Returns:
- the gh notification stream
-
since
Since gh notification stream.- Parameters:
dt
- the dt- Returns:
- the gh notification stream
-
nonBlocking
If set to true,iterator()
will stop iterating instead of blocking and waiting for the updates to arrive.- Parameters:
v
- the v- Returns:
- the gh notification stream
-
iterator
-
markAsRead
Mark as read.- Throws:
IOException
- the io exception
-
markAsRead
Marks all the notifications as read.- Parameters:
timestamp
- the timestamp- Throws:
IOException
- the io exception
-