Skip to content

Feature Request: Documentation #28

Closed
carlskii opened this Issue Mar 4, 2014 · 5 comments

3 participants

@carlskii
carlskii commented Mar 4, 2014

Please provide description for each of the URL within the tornado-celery/handlers.py example.

@mher mher added the enhancement label Mar 4, 2014
@AlJohri
AlJohri commented Apr 9, 2014

+1 :)

@AlJohri
AlJohri commented Apr 13, 2014

@mher I don't entirely understand how tornado-celery consumes tasks.

I was reading this blog post to try to understand the various methods of integrating celery and tornado.

It seems to me that tornado-celery provides an HTTP API for interacting with celery tasks but there's no easy way to notify the main tornado app when a task completes with polling -- is this correct?

@AlJohri
AlJohri commented Apr 13, 2014

As I'm reading further, I see that tornado-celery uses pika for a non-blocking AMQP client and supports using send_task or apply_async with a non-blocking producer.

Is there any way to set up a non-blocking consumer? I'd like to be able to utilize my tornado eventloop (or perhaps another tornado eventloop in a separate process) to perform non-blocking tasks that simply scrape web pages. What's the easiest way to make this happen?

@AlJohri
AlJohri commented Apr 13, 2014

Okay so I see that tcelery maintains its own ioloop, https://github.com/mher/tornado-celery/blob/master/tcelery/__main__.py#L41.

In my tasks.py module, can I create an @celery.task that uses @gen.coroutine

        http_client = AsyncHTTPClient()
        response = yield http_client.fetch("http://example.com")

?

@mher
Owner
mher commented Apr 20, 2014

I've setup documentation for tornado-celery at http://tornado-celery.readthedocs.org. Feel free to send pull requests.

@mher mher closed this Apr 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.