<div dir="ltr"><div>Hi!</div><div>Whether Pony can make async database queries or not depends on the database driver. For example you can use the psycopg2 driver with the psycogreen module for PostgreSQL and it will allow you to make asynchronous queries. (see <a href="https://bitbucket.org/dvarrazzo/psycogreen/">https://bitbucket.org/dvarrazzo/psycogreen/</a>)</div>
<div>From the Pony ORM point of view using gevent is nothing different from a multi-threading application and Pony works fine with it. When working in a multi-threading environment, Pony creates a separate database connection for each thread. If your application is going to create a lot of micro-threads, we'd recommend you to call disconnect() method of your Pony Database object in each miсro-thread before the thread is done. </div>
<div>Also we'd recommend to limit the number of micro-threads which work with the database simultaneously using the gevent.pool. Having too many simultaneous connections to the database can hurt the database performance.</div>
<div><br></div><div>Regards,</div><div>Alexey</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 9, 2014 at 6:48 AM, 王飞 <span dir="ltr"><<a href="mailto:gf0842wf@gmail.com" target="_blank">gf0842wf@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi!<div><div>Can we combine ponyorm with gevent to query asynchronously?</div></div></div>
<br>_______________________________________________<br>
ponyorm-list mailing list<br>
<a href="mailto:ponyorm-list@ponyorm.org">ponyorm-list@ponyorm.org</a><br>
<a href="/ponyorm-list" target="_blank">/ponyorm-list</a><br>
<br></blockquote></div><br></div>