zytedata/python-zyte-api

Simplify connection count and session management

Gallaecio opened this issue · 0 comments

Current:

    connection_count = 15
    client = AsyncClient(n_conn=connection_count)
    async with create_session(connection_count) as session:
        responses = client.request_parallel_as_completed(
            ...,
            session=session,
        )

We could turn that into something more like:

    client = AsyncClient(n_conn=15)
    async with client.create_session() as session:
        responses = session.request_parallel_as_completed(
            ...,
        )