We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's take a look at the documentation example:
from growler import App app = App() @app.use def log_file(req, res): print("<{ip}> {req_path}".format(ip=req.ip, req_path=req.path)) @app.get("/") def index_file(req, res): res.send_text("index.") app.create_server_and_run_forever(host='0.0.0.0', port='8080')
Is index_file a coroutine from which I could do a yield from?
index_file
yield from
The text was updated successfully, but these errors were encountered:
Growler accepts both normal functions and coroutine functions as middleware, and will handle each appropriately.
Just adorn the function with @asyncio.coroutine and you can yield from all you like.
@asyncio.coroutine
Example 2 demonstrates this.
Note, I'm going to drop py3.4 support with my next version (v0.9.x), and I recommend using async & await notation instead of asyncio.coroutine
async
await
Sorry, something went wrong.
Ok, super! :) I didn't find this example in documentation.
No branches or pull requests
Let's take a look at the documentation example:
Is
index_file
a coroutine from which I could do ayield from
?The text was updated successfully, but these errors were encountered: