queuing task for frontend from backend (push queue)

430 views
Skip to first unread message

db.User('someone')

unread,
Oct 17, 2011, 6:47:07 AM10/17/11
to Google App Engine
Hi,

I have a task running on backend, which needs to schedule another
task to be run on frontend.

Can this be done?

Just omitting the 'target' param creates tasks which still run on the
backend.

(I'm using taskqueue API with the default push queue)

Thanks!

Greg Darke

unread,
Oct 18, 2011, 12:37:27 PM10/18/11
to db.User('someone'), Google App Engine
In the recent 1.5.5 release we added a feature to allow just this
behaviour.
If you pass the new module level constant DEFAULT_APP_VERSION as value
for the target parameter the task will be enqueued on the default
version of your application.

You can use it as follows:

from google.appengine.api import taskqueue

task = taskqueue.Task(url='/', target=taskqueue.DEFAULT_APP_VERSION)
taskqueue.Queue().add(task)

# Or the following one-liner:
taskqueue.add(url='/', target=taskqueue.DEFAULT_APP_VERSION)

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>

db.User('someone')

unread,
Oct 18, 2011, 12:57:24 PM10/18/11
to Google App Engine
Yep, found this in 1.5.5 release notes :)

Sidenote: 1.5.5 MSI failed to install on my XP

Thanks!

stevep

unread,
Oct 18, 2011, 1:32:03 PM10/18/11
to Google App Engine
Have not yet done this, but plan to experiment with it. Presumably if
I run my on-line call handler in a non-default version, I can make on-
line handler calls to DEFAULT task queue tasks such that my DEFAULT
instance ends up only processing TQ items. I'm seeing this as a means
to effect a pseudo-high-reliability TQ (granted many issues might
affect its reliability, but I'll have reasonable control over this).

Thanks,
stevep

Strom

unread,
Mar 14, 2013, 6:43:47 PM3/14/13
to google-a...@googlegroups.com, db.User('someone'), darke+...@google.com
Is this also possible with the Java SDK? I couldn't find any 'target' parameter.

Bogdan Nourescu

unread,
May 23, 2013, 9:00:46 AM5/23/13
to google-a...@googlegroups.com, db.User('someone'), darke+...@google.com
Here is the documentation on target parameter:
Reply all
Reply to author
Forward
0 new messages