About the @threaded decorator

9 views
Skip to first unread message

abki

unread,
Apr 6, 2011, 10:34:12 PM4/6/11
to Whirlwind
I would like to have more informations about the threaded decorator.
If I understand well, since mongo-async-python is not ready for
production we are stuck with this solution got handling blocking db
calls. I understand what @threaded does but what about it's side
effects about the application. It's a pretty common task to call the
db driver so where and when should I use the decorator ?

Thanks in advance,

abki_

Matt Dennebaum

unread,
Apr 7, 2011, 9:55:54 AM4/7/11
to whirlw...@googlegroups.com
Based on our initial testing we have seen no real downside to using the
@threaded decorator. That said you will only see a performance gain if
you use it on requests that include blocking io (database calls for
instance).

That said if you would prefer to use an async mongo driver I would
suggest that you check out the asyncmongo driver from bit.ly.
https://github.com/bitly/asyncmongo

best,
Matt

--

Matt Dennebaum, Chief Technology Officer
Wiredset * 425 West 13th Street Suite 504 * NY NY 10014

tel: 212.242.3400 ext: 123 * fax: 212.242.3464 * cel: n/a
W3: wiredset.com * e: ma...@wiredset.com * aim: mdennebaum2

Linkedin: http://www.linkedin.com/in/dennebaum

--

Amirouche Boubekki

unread,
Apr 7, 2011, 12:56:07 PM4/7/11
to whirlw...@googlegroups.com, Matt Dennebaum
thanks for the input.



2011/4/7 Matt Dennebaum <ma...@wiredset.com>

abki

unread,
Apr 8, 2011, 5:29:50 PM4/8/11
to Whirlwind
Could you briefly explain what the @threaded decorator does ?

Matt Dennebaum

unread,
Apr 8, 2011, 6:46:42 PM4/8/11
to whirlw...@googlegroups.com
Hey Abki,

Check out the @threaded section of the docs page on the wiki. This gives
a good overview of the functionality.
https://github.com/trendrr/whirlwind/wiki/Docs

For a deeper dive feel free to take a look at the
whirlwind.core.multithreading module
(https://github.com/trendrr/whirlwind/blob/master/whirlwind/core/multithreading.py).


best,
Matt

On 4/8/2011 5:29 PM, abki wrote:
> Could you briefly explain what the @threaded decorator does ?

--

Matt Dennebaum, Chief Technology Officer

Linkedin: http://www.linkedin.com/in/dennebaum

--

Reply all
Reply to author
Forward
0 new messages