Returns whether the job has already been completed with a value or an exception.
Returns whether the job has already been completed with a value or an exception.
Note: using this method yields nondeterministic dataflow programs.
true
if the job is already completed, false
otherwise.
When the job is completed, either through an exception, or a value, apply the provided function.
When the job is completed, either through an exception, or a value, apply the provided function.
If the job has already been completed, this will either be applied immediately or be scheduled asynchronously.
Multiple callbacks may be registered; there is no guarantee that they will be executed in a particular order.
The provided callback always runs in the provided implicit
ExecutionContext
, though there is no guarantee that the
execute()
method on the ExecutionContext
will be called once
per callback or that execute()
will be called in the current
thread. That is, the implementation may run multiple callbacks
in a batch within a single execute()
and it may run
execute()
either immediately or asynchronously.
When this job is cancelled, apply the provided function.
When this job is cancelled, apply the provided function.
Multiple callbacks may be registered; there is no guarantee that they will be executed in a particular order.
The provided callback always runs in the provided implicit
ExecutionContext
, though there is no guarantee that the
execute()
method on the ExecutionContext
will be called once
per callback or that execute()
will be called in the current
thread. That is, the implementation may run multiple callbacks
in a batch within a single execute()
and it may run
execute()
either immediately or asynchronously.
When this job is queued, apply the provided function.
When this job is queued, apply the provided function.
Multiple callbacks may be registered; there is no guarantee that they will be executed in a particular order.
The provided callback always runs in the provided implicit
ExecutionContext
, though there is no guarantee that the
execute()
method on the ExecutionContext
will be called once
per callback or that execute()
will be called in the current
thread. That is, the implementation may run multiple callbacks
in a batch within a single execute()
and it may run
execute()
either immediately or asynchronously.
When this job has started, apply the provided function.
When this job has started, apply the provided function.
Multiple callbacks may be registered; there is no guarantee that they will be executed in a particular order.
The provided callback always runs in the provided implicit
ExecutionContext
, though there is no guarantee that the
execute()
method on the ExecutionContext
will be called once
per callback or that execute()
will be called in the current
thread. That is, the implementation may run multiple callbacks
in a batch within a single execute()
and it may run
execute()
either immediately or asynchronously.
Supports Scala's Await.ready(atmost) which awaits the completion of the job.
Supports Scala's Await.ready(atmost) which awaits the completion of the job.
maximum wait time, which may be negative (no waiting is done), Duration.Inf for unbounded waiting, or a finite positive duration.
ScalaJobHandle
InterruptedException
if the current thread is interrupted while waiting.
TimeoutException
if after waiting for the specified time the job
is still not ready.
Supports Scala's Await.result(atmost) which awaits the completion of the job and returns the
result (of type T
).
Supports Scala's Await.result(atmost) which awaits the completion of the job and returns the
result (of type T
).
maximum wait time, which may be negative (no waiting is done), Duration.Inf for unbounded waiting, or a finite positive duration.
the result value if job is completed within the specific maximum wait time.
Exception
the underlying exception on the execution of the job.
Return the current state of the job.
The result value of the job.
The result value of the job.
If the job is not completed the returned value will be None
.
If the job is completed the value will be Some(Success(t))
.
if it contains a valid result, or Some(Failure(error))
if it contains
an exception.
A handle to a submitted job. Allows for monitoring and controlling of the running remote job.