public interface ComputeJobContinuation
Modifier and Type | Method and Description |
---|---|
void |
callcc()
Resumes job if it was held by
holdcc() method. |
boolean |
heldcc()
Checks if job execution has been temporarily held (suspended).
|
<T> T |
holdcc()
Holds (suspends) a given job indefinitely until
callcc() is called. |
<T> T |
holdcc(long timeout)
Holds (suspends) a given job for specified timeout or until
callcc() is called. |
boolean heldcc()
If job has completed its execution, then false
is always returned.
True
if job has been held.<T> T holdcc()
callcc()
is called.
Job will remain in active queue, but its heldcc()
method will
return true
. Implementations of CollisionSpi
should check
if jobs are held or not as needed.
All jobs should stop their execution and return right after calling
'holdcc(..)'
method. For convenience, this method always returns null
,
so you can hold and return in one line by calling 'return holdcc()'
method.
If job is not running or has completed its execution, then no-op.
The 'cc'
suffix stands for 'current-continuation'
which is a
pretty standard notation for this concept that originated from Scheme programming
language. Basically, the job is held to be continued later, hence the name of the method.
null
for convenience to be used in code with return statement.IllegalStateException
- If job has been already held before.<T> T holdcc(long timeout)
callcc()
is called.
Holds (suspends) a given job for specified timeout or until callcc()
is called.
Job will remain in active queue, but its heldcc()
method will
return true
. Implementations of CollisionSpi
should check
if jobs are held or not as needed.
All jobs should stop their execution and return right after calling
'holdcc(..)'
method. For convenience, this method always returns null
,
so you can hold and return in one line by calling 'return holdcc()'
.
If job is not running or has completed its execution, then no-op.
The 'cc'
suffix stands for 'current-continuation'
which is a
fairly standard notation for this concept. Basically, the job is held to
be continued later, hence the name of the method.
timeout
- Timeout in milliseconds after which job will be automatically resumed.null
for convenience to be used in code with return statement.IllegalStateException
- If job has been already held beforevoid callcc()
holdcc()
method. Resuming job means that
ComputeJob.execute()
method will be called again. It is user's responsibility to check,
as needed, whether job is executing from scratch and has been resumed.
Note that the job is resumed with exactly the same state as of when it was 'held' via
the holdcc()
method.
If job is not running, has not been suspended, or has completed its execution, then no-op.
The method is named after 'call-with-current-continuation'
design pattern, commonly
abbreviated as 'call/cc'
, which originated in Scheme programming language.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024