## Session


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


Usage

``` python
Session(
    *,
    username,
    password,
    transport=None,
    retry_limit=600.0,
    pending_limit=600.0,
    progress_interval=10.0
)
```


It takes the arguments of [AsyncSession](AsyncSession.md#oxyscraper.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__()](#__enter__) | Start the portal, and open the session inside it. |
| [__exit__()](#__exit__) | Stop every unfinished run, and close the portal. |
| [execute()](#execute) | Start a run, and return its jobs as they finish. |
| [get()](#get) | Return a job as it stands, at once. |

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


#### \_\_enter\_\_()


Start the portal, and open the session inside it.


Usage

``` python
__enter__()
```


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


#### \_\_exit\_\_()


Stop every unfinished run, and close the portal.


Usage

``` python
__exit__(*exc_info)
```


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


#### execute()


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


Usage

``` python
execute(
    payloads,
    *,
    realtime=False,
    destination=None,
    run_log=None,
    check_storage=True,
    output_types=()
)
```


It takes the arguments of [AsyncSession.stream](AsyncSession.md#oxyscraper.AsyncSession.stream).


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


#### get()


Return a job as it stands, at once.


Usage

``` python
get(job_id, *, output_types=())
```


It takes the arguments of [AsyncSession.get](AsyncSession.md#oxyscraper.AsyncSession.get).
