Run

The jobs of one run, each as it finishes.

Usage

Source

Run(
    jobs,
    progress,
)

Iteration yields each job once, so all, one and partitions return only the jobs it has not yet yielded. After the last job, it raises IncompleteRunError if a payload ended with no done or faulted job or an upload failed, and raises it again on each later call.

Attributes

Name Description
progress The number of the run’s payloads in each state, now.

progress

The number of the run’s payloads in each state, now.

progress: Progress

Methods

Name Description
__iter__() Yield each job as it finishes.
all() Wait for every job, and return them in the order they finished.
one() Wait for the run’s only job, and return it.
partitions() Yield the jobs in lists of size as they finish, with a shorter last list.

__iter__()

Yield each job as it finishes.

Usage

Source

__iter__()

all()

Wait for every job, and return them in the order they finished.

Usage

Source

all()
Raises
IncompleteRunError
If a payload ended with no done or faulted job or an upload failed, with the jobs collected so far in its jobs.

one()

Wait for the run’s only job, and return it.

Usage

Source

one()
Raises
ValueError
If the run holds more or fewer than one job.

partitions()

Yield the jobs in lists of size as they finish, with a shorter last list.

Usage

Source

partitions(size)

When the run raises, the partial list comes first, so a bulk write keeps every job.


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