# parsl.app.futures.DataFuture

class parsl.app.futures.DataFuture(fut: Future, file_obj: File, tid: int)

  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

    Construct the DataFuture object.

    If the file_obj is a string convert to a File.

    Parameters:

      - fut (-) – Future that this DataFuture will track. Completion of `fut` indicates that the data is ready.

      - file_obj (-) – File that this DataFuture represents the availability of

    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.
  `cancelled`() | 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

  `filename` | Filepath of the File object this datafuture represents.
  `filepath` | Filepath of the File object this datafuture represents.
  `tid` | Returns the task_id of the task that will resolve this DataFuture.

  cancel()

    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.

  cancelled()

    Return True if the future was cancelled.

  property filename

    Filepath of the File object this datafuture represents.

  property filepath

    Filepath of the File object this datafuture represents.

  parent_callback(parent_fu)

    Callback from executor future to update the parent.

    Updates the future with the result (the File object) or the parent future’s exception.

    Parameters:

      parent_fu (-) – Future returned by the executor along with callback

    Returns:

      - None

  running()

    Return True if the future is currently executing.

  property tid

    Returns the task_id of the task that will resolve this DataFuture.