Tornado and Celery?

301 views
Skip to first unread message

Dan Stromberg

unread,
Jul 23, 2016, 9:13:13 PM7/23/16
to python-...@googlegroups.com

Hi folks

What's the best way, with Tornado coroutines, to call a celery task and get the result back into the Tornado code?

I saw this:
Is one of these a good way to go?

Is there a best practice?

Thanks!

--
Dan Stromberg

Kevin LaTona

unread,
Jul 23, 2016, 10:56:39 PM7/23/16
to python-tornado@googlegroups.com Server

Depends which of the examples you are looking at, as from my quick look they appearing kind of dated.

Depending what version of Tornado and Python you are running, mostly likely there is newer caller styles that you can look at.

Stop by the Tornado.org latest documents and look at the sample code Ben has in there as it may give you more ideas.

If you are on Python3.5 you can also look at the Async await call styles http://www.tornadoweb.org/en/stable/guide/coroutines.html#python-3-5-async-and-await

Beware as there is lots and lots of old sample code floating about on SO and Gist so keep an eye on when it created as lots of new subtle call adjustments have been added in last few years and that old stuff can send you down the rabbits’s hole needlessly.

-Kevin

Dan Stromberg

unread,
Jul 26, 2016, 11:09:51 AM7/26/16
to python-...@googlegroups.com
On Sat, Jul 23, 2016 at 7:56 PM, Kevin LaTona <li...@studiosola.com> wrote:

Depends which of the examples you are looking at, as from my quick look they appearing kind of dated.

Depending what version of Tornado and Python you are running, mostly likely there is newer caller styles that you can look at.
I'm on Python 2.7 (sigh), and Tornado 4.3.
 
Stop by the Tornado.org latest documents and look at the sample code Ben has in there as it may give you more ideas.
Going to tornado.org gives me a generic IIS web page.  :-S
 
If you are on Python3.5 you can also look at the Async await call styles http://www.tornadoweb.org/en/stable/guide/coroutines.html#python-3-5-async-and-await
That's something to look forward to.
 
Beware as there is lots and lots of old sample code floating about on SO and Gist so keep an eye on when it created as lots of new subtle call adjustments have been added in last few years and that old stuff can send you down the rabbits’s hole needlessly.
Any suggestions?  Googling sounds fraught in this case.

--
Dan Stromberg

Kevin LaTona

unread,
Jul 26, 2016, 12:11:22 PM7/26/16
to python-tornado@googlegroups.com Server

On Jul 26, 2016, at 8:09 AM, Dan Stromberg <stro...@gmail.com> wrote:

Stop by the Tornado.org latest documents and look at the sample code Ben has in there as it may give you more ideas.
Going to tornado.org gives me a generic IIS web page.  :-S


Sorry…. it’s at    http://www.tornadoweb.org/en/stable/


Reply all
Reply to author
Forward
0 new messages