You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/peewee_async/tornado.rst
+5-117Lines changed: 5 additions & 117 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,129 +9,17 @@ The complete working example is provided below. And here are some general notes:
9
9
10
10
1. **Be aware of current asyncio event loop!**
11
11
12
-
In the provided example we use the default event loop everywhere, and that's OK. But if you see your application got silently stuck, that's most probably that some task is started on different loop and will never complete as long as that loop is not running.
12
+
In the provided example we use the default event loop everywhere, and that's OK. But if you see your application got silently stuck, that's most probably that some task is started on the different loop and will never complete as long as that loop is not running.
The ``CreateHandler`` demostrates that, ``current_task()`` returns ``None`` until taks is run explicitly.
16
+
The ``CreateHandler`` demostrates that, ``current_task()`` returns ``None`` until task is run explicitly.
17
17
18
18
3. Transactions **must** run within task context.
19
19
20
20
All transaction operations have to be done within task. So if you need to run a transaction from Tornado handler, you have to wrap your call into task with ``create_task()`` or ``ensure_future()``.
21
21
22
-
**Also note:** if you spawn an extra task during transaction, it will run outside of transaction.
22
+
**Also note:** if you spawn an extra task during a transaction, it will run outside of that transaction.
0 commit comments