Session
Submit payloads and fetch their jobs from sync code, inside a with block.
Usage
Session(
*,
username,
password,
transport=None,
retry_limit=600.0,
pending_limit=600.0,
progress_interval=10.0
)It takes the arguments of AsyncSession, and runs one through an anyio blocking portal. The portal’s thread stays open only inside the block, because an open portal blocks the interpreter’s exit.
Methods
| Name | Description |
|---|---|
| __enter__() | Start the portal, and open the session inside it. |
| __exit__() | Stop every unfinished run, and close the portal. |
| execute() | Start a run, and return its jobs as they finish. |
| get() | Return a job as it stands, at once. |
__enter__()
Start the portal, and open the session inside it.
Usage
__enter__()__exit__()
Stop every unfinished run, and close the portal.
Usage
__exit__(*exc_info)execute()
Start a run, and return its jobs as they finish.
Usage
execute(
payloads,
*,
realtime=False,
destination=None,
run_log=None,
check_storage=True,
output_types=()
)It takes the arguments of AsyncSession.stream.
get()
Return a job as it stands, at once.
Usage
get(job_id, *, output_types=())It takes the arguments of AsyncSession.get.