|
|
|
|
|
by AnkhMorporkian
3428 days ago
|
|
You need to use the asyncio (or equivalent) event loop if you want to use the asnycio module. loop.run_until_complete() is synchronous though, so you would simply call that and it will block the control flow despite that function being async. You can definitely mix it with legacy code. I would recommend against it, but if you had an existing framework, you could just make the endpoints lambdas that are something like: app.route("/whatever", lambda: loop.run_until_complete(async_handler_function()))
|
|