title: How to dynamically add / remove periodic tasks to Celery (celerybeat)
body: <p>If I have a function defined as follows:</p>
  
  <pre><code>def add(x,y):
    return x+y
  </code></pre>
  
  <p>Is there a way to dynamically add this function as a celery PeriodicTask and kick it off at runtime? I'd like to be able to do something like (pseudocode):</p>
  
  <pre><code>some_unique_task_id = celery.beat.schedule_task(add, run_every=crontab(minute="*/30"))
  celery.beat.start(some_unique_task_id)
  </code></pre>
  
  <p>I would also want to stop or remove that task dynamically with something like (pseudocode):</p>
  
  <pre><code>celery.beat.remove_task(some_unique_task_id)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>celery.beat.stop(some_unique_task_id)
  </code></pre>
  
  <p>FYI I am not using djcelery, which lets you manage periodic tasks via the django admin.</p>