Reputation: 1507
Can we specify Cron jobs dynamically? I want to define a task to occur at some time in future .How can I achieve that functionality? This is need to be done in Google App Engine. The ony way that I have found is to do polling
Upvotes: 2
Views: 482
Reputation: 461
You can use Task Queues, as described here. Task queues have the same duration constraint of Cron Jobs (10 minutes), and you can specify the time at which the Task will be executed with the countdownMillis
method on the TaskOptions
object. For example:
Queue myQueue = QueueFactory.getQueue("myQueue");
myQueue.add(TaskOptions.Builder.withUrl("/myTask").countdownMillis(2000));
will delay the execution of the task at URL /myTask
on the queue myQueue
by 2 seconds. Have a look here to understand how to properly configure a task queue for your needs.
Upvotes: 3
Reputation: 19854
Yes use task queues. Use countdown for example to control when it starts.
Upvotes: 0