Skip to content

salvus.flow.acta.session.future

salvus.flow.acta.session.future salvus flow acta session future

Deferred task execution with synchronous and asynchronous result access.

Functions

gather()

def gather(futures: Future) -> list[SessionResult]: ...

Run futures concurrently and return their results synchronously.

Raise the first failure after siblings finish. Each future retains its own result or error. Async callers can use asyncio.gather directly.

Parameters
  • futures Future — The futures to demand. Their order is the order of the results.
Returns list[SessionResult] — One result per future, in the order given.

Classes

Future

class Future(builtins.object):
    def __init__(
        self, session: Session, task_name: str, params: dict[str, Any]
    ) -> None: ...

A deferred task call bound to its submitting session.

Parameters
  • session Session — Session used when the result is requested, even outside its context block.
  • task_name str — Registered task name.
  • params dict[str, Any] — Arguments accepted by Session.run.
Attributes
done bool

Return whether the future has completed, successfully or with an error.

key str | None

Return the envelope key, or None before it is known.

task_name str

Return the registered task name.

Methods
result()
def result(self) -> SessionResult: ...

Run the task if needed and return its result synchronously.

Reuse completed results and re-raise recorded failures.

Returns SessionResult — What Session.run returned for this call.