Releases: a-feld/pywreck
Releases · a-feld/pywreck
v0.5.2
v0.5.1
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)
v0.4.1
Bug Fixes
Fixed an issue where chunked request bytes were not fully consumed. This bug caused errors when chunked requests were issued prior to other requests on a reused connection object.
Full Changelog: v0.4.0...v0.4.1
v0.4.0
Bug Fix
Prevent concurrent access to the underlying connection when a request is in progress.
Example:
connection = await pywreck.Connection.create("www.example.com")
coros = (connection.request("GET", "/foo"), connection.request("GET", "/bar"))
await asyncio.gather(*coros)
Note: this request cannot execute concurrently since the underlying connection can only be used for one HTTP/1 request at a time. The exclusive access to the underlying connection is now enforced.
To execute this request concurrently, 2 separate connections must be opened:
coros = (pywreck.request("GET", "www.example.com", "/foo"), pywreck.request("GET", "www.example.com", "/bar"))
await asyncio.gather(*coros)
Full Changelog: v0.3.0...v0.4.0