title: Celery task that runs more tasks
body: <p>I am using celerybeat to kick off a primary task that kicks of a number of secondary tasks. I have both tasks written already. </p>
  
  <p>Is there a way to easily do this? Does Celery allow for tasks to be run from within tasks?</p>
  
  <p>My example:</p>
  
  <pre><code>@task
  def compute(users=None):
      if users is None:
          users = User.objects.all()
  
      tasks = []
      for user in users:
          tasks.append(compute_for_user.subtask((user.id,)))
  
      job = TaskSet(tasks)
      job.apply_async() # raises a IOError: Socket closed
  
  @task
  def compute_for_user(user_id):
      #do some stuff
  </code></pre>
  
  <p><code>compute</code> gets called from celerybeat, but causes an IOError when it tries to run <code>apply_async</code>. Any ideas?</p>