parsl.app.futures.DataFuture
- class parsl.app.futures.DataFuture(fut: Future, file_obj: File, tid: int | None = None)[source]
A datafuture points at an AppFuture.
We are simply wrapping a AppFuture, and adding the specific case where, if the future is resolved i.e file exists, then the DataFuture is assumed to be resolved.
- __init__(fut: Future, file_obj: File, tid: int | None = None) None [source]
Construct the DataFuture object.
If the file_obj is a string convert to a File.
- Parameters:
fut (-) – AppFuture that this DataFuture will track
file_obj (-) – Something representing file(s)
- Kwargs:
tid (task_id) : Task id that this DataFuture tracks
Methods
__init__
(fut, file_obj[, tid])Construct the DataFuture object.
add_done_callback
(fn)Attaches a callable that will be called when the future finishes.
cancel
()Cancel the future if possible.
Return True if the future was cancelled.
done
()Return True if the future was cancelled or finished executing.
exception
([timeout])Return the exception raised by the call that the future represents.
parent_callback
(parent_fu)Callback from executor future to update the parent.
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.
Attributes
Filepath of the File object this datafuture represents.
Filepath of the File object this datafuture represents.
Returns the task_id of the task that will resolve this DataFuture.
- 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.