title: Best way to schedule tasks to run in the future dynamically using celery + sqs
body: <p>So I'm struggling to figure out the optimal way to schedule some events to happen at some point in the future using celery. An example of this is when a new user has registered, we want to send them an email the next day. </p>
  
  <p>We have celery setup and some of you may allude to the <code>eta</code> parameter when calling <code>apply_async</code>. However that won't work for us, as we use SQS which has a visibility timeout that would conflict and generally the <code>eta</code> param shouldn't be used for lengthy periods.</p>
  
  <p>One solution we've implemented at this point is to create events and store them in the database with a 'to-process' timestamp (refers to when to process the event). We use the celery beat scheduler with a task that runs literally every second to see if there are any new events that are ready to process. If there are, we carry out the subsequent tasks.</p>
  
  <p>This solution works, although it doesn't feel great since we're queueing a task every second on SQS. Any thoughts or ideas on this would be great? </p>