I want to schedule a task (ie. a block of code) to be executed at a later time wherein the time and date of execution along with the other parameters are passed in as the task payload.
So we have a Python (Django) based Appengine application where:
The tasks are defined in tasks.py
@csrf_exempt
def task_myfunction(request):
if request.method == 'POST':
# Read POST parameters
# Perform task
return HttpResponse("Success")
Payload is added to the queue in views.py and the payload is POST-ed to the url provided, which maps to the function defined above.
from google.appengine.api import taskqueue
# ..Somewhere inside a view..
taskqueue.add(queue_name='myqueue', url='/task/myfunction', params={
# Specify parameters
})
Is there a way, I could specify the exact time of execution (with timezone) along with the payload data so that the task is automatically picked up from the queue and performed at that time instant.