All the gzip-related parameters are now explicit about whether
they compress or decompress and whether they apply to requests or
responses. For all the parameters that existed prior to 4.0
the old names are accepted as well, but for the new ones in 4.0
we don't need to worry about backwards-compatibility.
This is motivated by the potential confusion around the use of
gzip as a parameter to the Application constructor to indicate
compression of responses and to the HTTPServer constructor to
indicate decompression of requests.
Browsers that only support draft76 are now less common than those
that do not support websockets at all, so applications should
use their non-websocket workarounds for these browsers.
This allows error pages to be generated inline with the main code
instead of in write_error and is friendlier to generating error pages
from library code.
Closes#1064.
call_later is a less-verbose alternative to add_timeout with a
timedelta; call_at exists for symmetry. Both are named after
methods on the asyncio event loop, although there are small
variations (we support both args and kwargs while asyncio only supports
args; we use remove_timeout(handle) instead of handle.cancel()).
Closes#1049.
Clients created without force_instance=True were never getting
GC'd because we were using the wrong reference for the async_clients
instance cache.
To guard against future errors, failure to remove an instance
from the cache when we expected to now raises an error instead of
failing silently.
Closes#1079.
Methods like set_status are now disallowed once the websocket handshake
has begun, but may be used before then. This applies to application
overrides of prepare() and to WebSocketHandler.get's internal error
handling.
Closes#1065.
Collect all timeouts to be run before running any of them; this
prevents starvation when a slow callback reschedules itself.
Call time() again before setting poll_timeout to avoid scheduling
anomalies with slow callbacks.
Closes#947.