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
my code :
#!/usr/bin/env python from __future__ import print_function from tornado import ioloop, gen from tornado_mysql import pools pools.DEBUG = True POOL = pools.Pool( dict(host='127.0.0.1', port=3306, user='root', passwd='123456', db='lottery'), max_idle_connections=1, max_recycle_sec=3) @gen.coroutine def getAll(): cur=yield POOL.execute("SELECT redball1 FROM lottery") print(cur.fetchall()) @gen.coroutine def main(): getAll() ioloop.IOLoop.current().run_sync(main) print(POOL._opened_conns)
But print is "0".why
The text was updated successfully, but these errors were encountered:
Example is here: https://github.com/PyMySQL/Tornado-MySQL/blob/master/example/pool.py
Sorry, something went wrong.
@gen.coroutine def main(): getAll()
You forget yield.
yield
@gen.coroutine def main(): yield getAll()
Nothing happens when i add yield
4951ec2
Thanks for reporting. Fixed in master.
No branches or pull requests
my code :
But print is "0".why
The text was updated successfully, but these errors were encountered: