From ecd7e5bdd39dde0ef611ef8e1598f824d7e8e4a0 Mon Sep 17 00:00:00 2001 From: Andrew Bentley Date: Wed, 25 Jan 2017 23:01:57 +1100 Subject: [PATCH] Update blueprints docs with correct listener example --- docs/blueprints.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/blueprints.md b/docs/blueprints.md index 65907750..be95c5cc 100644 --- a/docs/blueprints.md +++ b/docs/blueprints.md @@ -107,13 +107,13 @@ Available events are: ```python bp = Blueprint('my_blueprint') -@bp.listen('before_server_start') -async def setup_connection(): +@bp.listener('before_server_start') +async def setup_connection(app, loop): global database database = mysql.connect(host='127.0.0.1'...) -@bp.listen('after_server_stop') -async def close_connection(): +@bp.listener('after_server_stop') +async def close_connection(app, loop): await database.close() ```