2010-2-12

21:44 idangazit
there's whoever creates the task (probably a view in your django app)
21:44 idangazit
there's the AMQP broker (probably rabbitmq, unless you're masochistic)
21:45 idangazit
and then there's the celery workers.
21:45 idangazit
or more accurately, celery daemons, each of which can run several celery workers at once.
21:45 idangazit
there's nothing at all that says that any of these three elements need to share a machine
21:46 idangazit
you can have your appserver fire off tasks which get queued on rabbitmq on another machine
21:46 idangazit
and yet another machine has a celery daemon with workers who are processing that queue's tasks.
21:47 idangazit
so yes, the run() only gets executed wherever the worker is at.
21:49 donspaulding
idangazit: ok, that's pretty much how I understood it. The magic celery works is just the passing of args from the requesting function to the workers, and potentially dealing with the result, right?
21:50 idangazit
the magic celery works is in hiding the plumbing of AMQP from you :)
21:50 idangazit
but yeah, you enqueue tasks with some args, magically, somewhere else there is a worker which runs some logic on that data
21:51 donspaulding
idangazit: what does adding celery to my INSTALLED_APPS buy me?
21:53 idangazit
um, the ability to enqueue tasks using the same db django is using?
21:54 idangazit
there's probably more but my brain is kinda offline.
21:54 idangazit
tbh I've never used celery without django, so I don't really know what is different about using celery w/o django.
22:03 davidcramer
auto detection of tasks
22:19 asksol
donspaulding: you don't need the task on the client
22:19 asksol
you can execute it by name
22:19 asksol
or just register a dummy task with that name
22:20 asksol
adding to INSTALLED_APPS just adds the celery models to the app registry
22:20 asksol
so the tables are created on syncdb, etc
22:22 asksol
I should create an easy way to execute a task using just the name
22:22 donspaulding
asksol: sorry, I'm sure this is in the docs, but what does celery store in the DB? Just results?
22:22 asksol
yeah
22:22 asksol
just results, if using the database backend that is
22:23 asksol
and you can use it for messaging to if you use ghettoq
22:24 asksol
too
22:30 donspaulding
asksol: so, calling celery.registry.tasks.register() is only really useful if I'm making use of Django in the worker, right
22:30 donspaulding
?
22:31 asksol
no
22:31 asksol
it's what maps a task name to a task class
22:32 donspaulding
asksol: does a task need to be registered before it is .delay()ed?
22:32 asksol
so the message sent contains {"task_name": "celery.task.ping", "args": [], "kwargs": {}}
22:32 asksol
yeah
22:32 asksol
but you could use celery.messaging.TaskPublisher directly
22:32 asksol
or you could make a dummy task in the client
22:33 asksol
this is a work around, I think we should have a way to do this easily
22:33 donspaulding
asksol: I think I'm just coming up with too many stupid questions because I've not implemented enough yet. I'll come back when I've tried more things.
22:34 donspaulding
asksol: I'm not actually running into problems yet, just trying to understand everything I've read about celery up till now.
22:34 asksol
hehe, right
22:35 asksol
22:36 asksol
22:36 asksol
22:36 asksol
brb
Page 4 of 4   ← Previous  (344 total)