@@ -273,22 +273,12 @@ new head of the stack.
273
273
274
274
.. tip ::
275
275
276
- By context, we are actually referring to the context concept in either
277
- `aiocontextvars <https://github.com/fantix/aiocontextvars >`_ the optional
278
- dependency or `contextvars
279
- <https://docs.python.org/3.7/library/contextvars.html> `_ the new module in
280
- upcoming Python 3.7. Simply speaking, you may treat a function call chain
281
- including awaited :class: `~asyncio.Task ` created in the chain as in the
282
- same context, something like a thread local in asyncio.
283
-
284
- .. note ::
285
-
286
- And that is to say, `aiocontextvars
287
- <https://github.com/fantix/aiocontextvars> `_ is a required dependency for
288
- ``reuse `` to work correctly in Python 3.6 - actually ``reuse `` is the
289
- reason for introducing context in the first place. Without context, the
290
- stack is always empty for any :meth: `~gino.engine.GinoEngine.acquire ` thus
291
- no one could reuse any raw connection at all.
276
+ By context, we are actually referring to the context concept in
277
+ `contextvars <https://docs.python.org/3.7/library/contextvars.html >`_ the
278
+ new module in Python 3.7, and its partial backport `aiocontextvars
279
+ <https://github.com/fantix/aiocontextvars> `_. Simply speaking, you may
280
+ treat a series of function calls in a chain as in the same context, even if
281
+ there is an ``await ``. It's something like a thread local in asyncio.
292
282
293
283
:class: `~gino.engine.GinoConnection ` (2) may be created through
294
284
``acquire(reuse=True) `` too - because the stack is empty before (2), there is
@@ -519,11 +509,3 @@ at the creation of :class:`~gino.api.Gino` instance. Therefore, any
519
509
:class: `~sqlalchemy.sql.expression.Executable ` object has the ``gino ``
520
510
property for implicit execution. Similarly, the execution methods calls the
521
511
corresponding ones on the ``bind `` of the ``db `` instance.
522
-
523
- .. warning ::
524
-
525
- The assumption for code above to run as expected is having
526
- `aiocontextvars <https://github.com/fantix/aiocontextvars >`_ installed on
527
- Python 3.6, or directly using Python 3.7. Or else, nested implicit
528
- executions will always run in a different new connection. This may be not
529
- so important here, but it is crucial for transactions.
0 commit comments