public abstract class OnceUntilSucceedsTaskImpl extends TaskImpl
TaskImpl
that only executes once
as it cancels itself out of the task queue once completed,
until it succeeds (if it bails out with a
RuntimeException
or
returns false
,
it will remain in the task queue.OnceTaskImpl
,
Session.onEvent(Task)
,
Session.onEvent(jerklib.tasks.Task, jerklib.events.IRCEvent.Type...)
,
TaskImpl
,
IRCEvent.Type
Constructor and Description |
---|
OnceUntilSucceedsTaskImpl(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
receiveEvent(IRCEvent e)
recieveEvent() - receive IRCEvents
|
abstract boolean |
receiveEventOnce(IRCEvent e)
Process the
IRCEvent . |
addTaskListener, cancel, getName, getTaskListeners, isCanceled, removeTaskListener
public OnceUntilSucceedsTaskImpl(java.lang.String name)
public abstract boolean receiveEventOnce(IRCEvent e)
IRCEvent
.e
- the IRCEvent
to processfalse
, the task will
remain in the task queue; when returning true
,
it will be removed (and not executed any more)public final void receiveEvent(IRCEvent e)
e
- IRCEvent the event