Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Feature Request: Documentation #28

Closed
carlskii opened this Issue · 5 comments

3 participants

@carlskii

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

@mher mher added the enhancement label
@AlJohri

+1 :)

@AlJohri

@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

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

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

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

@mher mher closed this
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.