When you were running multiple applications using asyncio, sanic
must be closed as the latest order because it closes the loop.
The patch limits the behavior only when sanic created its own loop
by argument `loop=None`.
* Caching example using aiocache
* Caching example using aiocache
* Added aiocache to requirements
* Fixed example with newest aiocache
* Fixed bug in cache example
Simplifies request parameters, it defined a bit more than it had too,
added some docstrings and made the code simpler as well. Should now
raise a KeyError on __getitem__ as @amsb had noted on commit 9dd954b
* Reorder and clarify the 'Request Data' guide, adding a section on RequestParameters
* Clarify routing guide, adding introduction and HTTP types sections
* Clarify the use-cases of middleware
* Clean up formatting in the exceptions guide and add some common exceptions.
* Fix formatting of blueprints and add use-case example.
* Clarify the class-based views guide
* Clarify and fix formatting of cookies guide
* Clarify static files guide
* Clarify the custom protocols guide.
* Add more information to the deploying guide
* Fix broken list in the community extensions list.
* Add introduction and improve warning to contributing guide
* Expand getting started guide
* Reorder guides and add links between them
* Standardise heading capitalisation
Adds handling for closed transports in the server for `write_response`
as well as `write_error`, letting it all flow to `bail_out` seemed to be
a little light handed in terms of telling the logs where the
error actually occured.
Handling to fix the infinite `write_error` loop is still there and those
exceptions will get reported on in the debug logs.
When user specifies HTTP methods to function handlers, it automatically
will be overloaded unless they duplicate.
Example:
# This is a new route. It works as before.
@app.route('/overload', methods=['GET'])
async def handler1(request):
return text('OK1')
# This is the exiting route but a new method. They are merged and
# work as combined. The route will serve all of GET, POST and PUT.
@app.route('/overload', methods=['POST', 'PUT'])
async def handler2(request):
return text('OK2')
# This is the existing route and PUT method is the duplicated method.
# It raises RouteExists.
@app.route('/overload', methods=['PUT', 'DELETE'])
async def handler3(request):
return text('Duplicated')