Skip to content

Commit 4180f01

Browse files
simplified asgi examples
1 parent 0c69759 commit 4180f01

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

engineio/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
if sys.version_info >= (3, 5): # pragma: no cover
66
from .asyncio_server import AsyncServer
77
from .async_tornado import get_tornado_handler
8+
from .async_asgi import create_asgi_app
89
else: # pragma: no cover
910
AsyncServer = None
1011

1112
__version__ = '2.3.2'
1213

1314
__all__ = ['__version__', 'Middleware', 'Server']
1415
if AsyncServer is not None: # pragma: no cover
15-
__all__ += ['AsyncServer', 'get_tornado_handler']
16+
__all__ += ['AsyncServer', 'get_tornado_handler', 'create_asgi_app']

examples/asgi/latency.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
import uvicorn
33

44
import engineio
5-
from engineio.async_asgi import create_asgi_app
65

76
eio = engineio.AsyncServer(async_mode='asgi')
8-
app = create_asgi_app(eio, static_files={
7+
app = engineio.create_asgi_app(eio, static_files={
98
'/': {'content_type': 'text/html', 'filename': 'latency.html'},
109
'/static/engine.io.js': {'content_type': 'application/javascript',
1110
'filename': 'static/engine.io.js'},

examples/asgi/simple.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
import uvicorn
33

44
import engineio
5-
from engineio.async_asgi import create_asgi_app
65

76
eio = engineio.AsyncServer(async_mode='asgi')
8-
app = create_asgi_app(eio, static_files={
7+
app = engineio.create_asgi_app(eio, static_files={
98
'/': {'content_type': 'text/html', 'filename': 'simple.html'},
109
'/static/engine.io.js': {'content_type': 'application/javascript',
1110
'filename': 'static/engine.io.js'}

0 commit comments

Comments
 (0)