v0.5.0
Breaking Changes
Timeouts now encompass the entire request/response cycle
The timeout API has been simplified to:
- A timeout argument that tracks the entire request/response cycle
- A connection close timeout (if using the Connection API)
request/response API example
# The following call can take at most 1 second to complete
response = await pywreck.head("www.example.com", "/", timeout=1.0)
Connection API example
# Upon exiting the "async with" block, wait up to 1 second for the connection
# to close before forcing the connection to close
async with await pywreck.Connection.create(
"www.example.com",
close_timeout=1.0,
) as conn:
# Retrieve the response with a 1 second timeout on the request
response = await conn.request("HEAD", "/", timeout=1.0)