Session

Submit payloads and fetch their jobs from sync code, inside a with block.

Usage

Source

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

Source

__enter__()

__exit__()

Stop every unfinished run, and close the portal.

Usage

Source

__exit__(*exc_info)

execute()

Start a run, and return its jobs as they finish.

Usage

Source

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

Source

get(job_id, *, output_types=())

It takes the arguments of AsyncSession.get.


oxyscraper is not affiliated with or endorsed by Oxylabs. Oxylabs and Oxy are trademarks of Oxylabs.