parsl.dataflow.futures.AppFuture

class parsl.dataflow.futures.AppFuture(parent, tid=None, stdout=None, stderr=None)[source]

An AppFuture wraps a sequence of Futures which may fail and be retried.

An AppFuture starts with no parent future. A sequence of parent futures may be assigned by code outside of this class, by passing that new parent future into “update_future”.

The AppFuture will set its result to the result of the parent future, if that parent future completes without an exception. This result setting should cause .result(), .exception() and done callbacks to fire as expected when a Future has a result set.

The AppFuture will not set its result to the result of the parent future, if that parent future completes with an exception, and if that parent future has retries left. In that case, no result(), exception() or done callbacks should report a result.

The AppFuture will set its result to the result of the parent future, if that parent future completes with an exception and if that parent future has no retries left, or if it has no retry field. .result(), .exception() and done callbacks should give a result as expected when a Future has a result set

The parent future may return a RemoteException as a result (rather than raising it as an exception) and AppFuture will treat this an an exception for the above retry and result handling behaviour.

__init__(parent, tid=None, stdout=None, stderr=None)[source]

Initialize the AppFuture.

Parameters:parent (-) – The parent future if one exists A default value of None should be passed in if app is not launched
KWargs:
  • tid (Int) : Task id should be any unique identifier. Now Int.
  • stdout (str) : Stdout file of the app.
    Default: None
  • stderr (str) : Stderr file of the app.
    Default: None

Methods

__init__(parent[, tid, stdout, stderr]) Initialize the AppFuture.
add_done_callback(fn) Attaches a callable that will be called when the future finishes.
cancel() Cancel the future if possible.
cancelled() Return True if the future was cancelled.
done() Return True of the future was cancelled or finished executing.
exception([timeout]) Return the exception raised by the call that the future represents.
parent_callback(executor_fu) Callback from a parent future to update the AppFuture.
result([timeout]) Return the result of the call that the future represents.
running() Return True if the future is currently executing.
set_exception(exception) Sets the result of the future as being the given exception.
set_result(result) Sets the return value of work associated with the future.
set_running_or_notify_cancel() Mark the future as running or process any cancel notifications.
update_parent(fut) Add a callback to the parent to update the state.

Attributes

outputs
stderr
stdout
tid