Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa35e2d30c
|
||
|
|
850d5dda35
|
||
|
|
270a0d87fc
|
||
|
|
59f1a8227f
|
||
|
|
9a68d10868
|
||
|
|
87d1b0acb1
|
||
|
|
dfc5d70eec
|
||
|
|
08370c4963
|
||
|
|
01a54e3fb5
|
@@ -29,22 +29,9 @@ class KayaMixin(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def setup(self, loop: AbstractEventLoop) -> None:
|
def setup(self, loop: AbstractEventLoop) -> None:
|
||||||
"""Called on lifespan startup (default: no-op).
|
"""Called on lifespan startup (default: no-op)."""
|
||||||
|
|
||||||
Under RSGI (granian) the loop is NOT yet running when this is
|
|
||||||
called: schedule work on the passed ``loop`` (e.g.
|
|
||||||
``loop.create_task``) instead of calling
|
|
||||||
``asyncio.get_running_loop()``, which raises ``RuntimeError``
|
|
||||||
there. Under ASGI the lifespan runs inside a coroutine, so a
|
|
||||||
running loop happens to be available — do not rely on that.
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def shutdown(self, loop: AbstractEventLoop) -> None:
|
def shutdown(self, loop: AbstractEventLoop) -> None:
|
||||||
"""Called on lifespan shutdown (default: no-op).
|
"""Called on lifespan shutdown (default: no-op)."""
|
||||||
|
|
||||||
As with :meth:`setup`, use the passed ``loop``; it may already be
|
|
||||||
stopped under RSGI, so ``asyncio.get_running_loop()`` is not
|
|
||||||
reliable here either.
|
|
||||||
"""
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user