ewoksjob.client.celery.futures.CeleryFuture#

class ewoksjob.client.celery.futures.CeleryFuture(uuid, async_result=None)[source]#

Bases: FutureInterface

Parameters:
  • uuid (str)

  • async_result (Optional[AsyncResult])

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

aborted()[source]#

Return True if the task is (being) aborted.

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

cancelled()[source]#

Return True if the future was cancelled.

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, interval=None, **kwargs)[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.

  • interval (Optional[float])

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

running()[source]#

Return True if the future is currently executing.

Return type:

bool

property task_id: str#
property uuid: str#

Identifier of the call that the future represents.