title: Questions about Celery
body: <p>I'm trying to learn what Celery is &amp; does and I've gone through some basic tutorials like <a href="http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html" rel="nofollow">first steps with Celery</a> and <a href="http://hairycode.org/2013/07/23/first-steps-with-celery-how-to-not-trip/" rel="nofollow">this</a> one, and I have a few questions about Celery:</p>
  
  <p>In the (first steps) tutorial, you start a Celery worker and then you can basically just open an interpreter &amp; call the task defined as:</p>
  
  <pre><code>&gt;&gt;&gt; from tasks import add
  &gt;&gt;&gt; add.delay(4, 4)
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>What's happening here? add() is a method that we wrote in the tasks file and we're calling add.delay(4,4). So we're calling a method over a method!? </p></li>
  <li><p>How does this work? How does the 'delay' method get added to 'add'?</p></li>
  <li><p>Does the Celery worker do the work of adding 4+4? As opposed to the work being done by the caller of that method? - like it would have been if I had just defined a method called add in the interpreter and just executed</p>
  
  <p>add(4,4)</p></li>
  <li><p>If the answer to 3 is yes, then how does Celery know it has to do some work? All we're doing is - importing a method from the module we wrote and call that method. How does control get passed to the Celery worker?</p></li>
  </ol>
  
  <p>Also, while answering #4, it'd also be great if you could tell me how you know this. I'd be very curious to know if these things are documented somewhere that I'm missing/failing to understand it, and how I could have known the answer. Thanks much in advance!</p>