--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a4c70d63-af3b-4f50-9493-b4d6bf5180a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CADypTEbpxN%3DmSkGSeqdbiXNQeGL%2B3BWwCv172pKk7ojj2P28mw%40mail.gmail.com.
Hi Kyle,I've created a similar layer on top of firebase-queue before, by "queueing" the tasks into a cron folder and then having a little maintenance script that ran on a regular interval and "moved" them into firebase-queue when the correct time interval occurred.This could be done with data structures or timestamps. With data structures, you would simply create a directory structure similar to a crontab definition: `/yyyy/mm/dd/hh` and you can query against that every hour to pick up any entries that should be queued to run. In my particular version of this, I also queried `any` on each path as a wildcard.With timestamps, you would simply construct a query with `orderBy(<timestamp).endAt( firebase.database.ServerValue.TIMESTAMP )`. Anything that has a timestamp less than "now" gets run. If it's a recurring event (indicated by adding something like `isRecurring`) then you simply put it back into the cron by adding the next interval onto the timestamp.Note that the timestamp approach is simpler to implement by a decent margin, but less robust (consider server crashes/restarts/bugs and edge cases start cropping up).☼, Kato
On Tue, Nov 29, 2016 at 2:55 PM, Kyle Morgan <kylemo...@gmail.com> wrote:
I'm new here, so forgive me if I don't follow any predefined format here.I love using Firebase queues. I'm wondering if there's a way to schedule a task. Instead of processing a task instantly, is there a way to schedule something to happen at a particular time?So let's say that I have a function that sends out an email to a user. I know I want to send that email at 3pm tomorrow. Should I store the time/data of "3pm" in the task and then just check if it's past that time yet? Or is there a better way to handle it?I'm sure there's no easy built-in way to do this, but maybe you can help me come up with the best way to implement this in Firebase.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a4c70d63-af3b-4f50-9493-b4d6bf5180a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.