ewoksjob.client.local.futures.LocalFuture#
- class ewoksjob.client.local.futures.LocalFuture(uuid, future=None)[source]#
Bases:
FutureInterface- Parameters:
uuid (
str)future (
Optional[Future])
- abort()[source]#
Abort the execution of the call that the future represents if possible.
Returns True if the future was aborted, False otherwise.
- Return type:
bool
- cancel()[source]#
Cancel the future if possible.
Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed.
- Return type:
bool
- done()[source]#
Return True of the future was cancelled, aborted or finished executing.
- Return type:
bool
- exception(timeout=None)[source]#
Return the exception raised by the call that the future represents.
- Parameters:
timeout (
Optional[float]) – The number of seconds to wait for the result if the future isn’t done. If None, then there is no limit on the wait time.- Return type:
Optional[Exception]- Returns:
The exception raised by the call that the future represents or None if the call completed without raising.
- Raises:
CancelledError – If the future was cancelled.
TimeoutError – If the future didn’t finish executing before the given timeout.
- failed()#
- Return type:
bool
- get(timeout=None, **kwargs)#
- Parameters:
timeout (
Optional[float])- Return type:
Any
- property job_id: str#
- property queue: str#
- ready()#
- Return type:
bool
- result(timeout=None)[source]#
Return the result of the call that the future represents.
- Parameters:
timeout (
Optional[float]) – The number of seconds to wait for the result if the future isn’t done. If None, then there is no limit on the wait time.- Return type:
Any- Returns:
The result of the call that the future represents.
- Raises:
CancelledError – If the future was cancelled.
TimeoutError – If the future didn’t finish executing before the given timeout.
Exception – If the call raised then that exception will be raised.
- revoke(terminate=False)#
- Parameters:
terminate (
bool)- Return type:
bool
- property task_id: str#
- property uuid: str#
Identifier of the call that the future represents.