[storm] using twisted-storm
James Henstridge
james at jamesh.id.au
Mon Apr 20 02:11:14 BST 2009
On Mon, Apr 20, 2009 at 7:43 AM, Lee Connell <lee.a.connell at gmail.com> wrote:
> Thanks James, I'll give it a go. Whenever deferToThread is run it creates a
> new thread correct? And within my deferToThread function is where I make my
> database calls?
Not quite. deferToThread() passes the job off to one of the threads
in the reactor's thread pool. So repeated jobs are likely to reuse
the same threads (and hence database connections).
Depending on the app, you might want to lower the minimum thread pool
size to increase the likelyhood that a connection will be reused.
James.
More information about the storm
mailing list