File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class ASGIApp(engineio.ASGIApp): # pragma: no cover
16
16
:param socketio_path: The endpoint where the Socket.IO application should
17
17
be installed. The default value is appropriate for
18
18
most cases.
19
+ :param on_startup: function to be called on application startup; can be
20
+ coroutine
21
+ :param on_shutdown: function to be called on application shutdown; can be
22
+ coroutine
19
23
20
24
Example usage::
21
25
@@ -30,7 +34,9 @@ class ASGIApp(engineio.ASGIApp): # pragma: no cover
30
34
uvicorn.run(app, host='127.0.0.1', port=5000)
31
35
"""
32
36
def __init__ (self , socketio_server , other_asgi_app = None ,
33
- static_files = None , socketio_path = 'socket.io' ):
37
+ static_files = None , socketio_path = 'socket.io' ,
38
+ on_startup = None , on_shutdown = None ):
34
39
super ().__init__ (socketio_server , other_asgi_app ,
35
40
static_files = static_files ,
36
- engineio_path = socketio_path )
41
+ engineio_path = socketio_path , on_startup = on_startup ,
42
+ on_shutdown = on_shutdown )
You can’t perform that action at this time.
0 commit comments