Skip to content

Does timeout=None work on httpx.AsyncClient.stream? #2055

Answered by tomchristie
williammh asked this question in Q&A
Discussion options

You must be logged in to vote

Can you show me how to replicate this?

I'm trying to see the issue you're describing. Here's a simple ASGI app...

import time


async def app(scope, receive, send):
    assert scope['type'] == 'http'

    await send({
        'type': 'http.response.start',
        'status': 200,
        'headers': [
            [b'content-type', b'text/plain'],
        ],
    })
    await send({
        'type': 'http.response.body',
        'body': b'Hello, ',
        'more_body': True
    })
    time.sleep(100)
    await send({
        'type': 'http.response.body',
        'body': b'world',
    })

Which I'm running with uvicorn...

$ uvicorn app:app
INFO:     Started server process [2329]
INFO:     Waiting 

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tomchristie
Comment options

You must be logged in to vote
5 replies
@tomchristie
Comment options

@adnaanbheda
Comment options

@tomchristie
Comment options

@adnaanbheda
Comment options

@pgjones
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants