## Run


The jobs of one run, each as it finishes.


Usage

``` python
Run(
    jobs,
    progress,
)
```


Iteration yields each job once, so [all](Run.md#oxyscraper.Run.all), [one](Run.md#oxyscraper.Run.one) and [partitions](Run.md#oxyscraper.Run.partitions) return only the jobs it has not yet yielded. After the last job, it raises [IncompleteRunError](IncompleteRunError.md#oxyscraper.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](#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__()](#__iter__) | Yield each job as it finishes. |
| [all()](#all) | Wait for every job, and return them in the order they finished. |
| [one()](#one) | Wait for the run's only job, and return it. |
| [partitions()](#partitions) | Yield the jobs in lists of `size` as they finish, with a shorter last list. |

------------------------------------------------------------------------


#### \_\_iter\_\_()


Yield each job as it finishes.


Usage

``` python
__iter__()
```


------------------------------------------------------------------------


#### all()


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


Usage

``` python
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

``` python
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

``` python
partitions(size)
```


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