Robert Christian
Robert Christian

Reputation: 18310

Google App Engine Flex Python 3.4 - *Pull Queues* are not supported in documentation nor code examples

Using Python 3.4 Google App Engine Flex.

Google documentation on using pull queues with Python says to "from google.appengine.api import taskqueue", but does not explain how to make taskqueue available to Python runtime.

They do link to "Easily Access Google API's from Python", where it explains how to install the api client via "pip install google-api-python-client"

This does not install the taskqueue lib.

From the previous doc, there is a link to "Installation", where it says:

Because the Python client libraries are not installed in the App Engine Python runtime environment, they must be vendored into your application just like third-party libraries.

This links to another page "Using third-party libraries", which states you need to either install a lib to /lib or use requirements.txt. Neither of these make taskueue available.

Searching for taskqueue.py in Google's github shows only an example module with the same name.

There is a documentation page on the module, but no information on how to install it.

There is a Python 2.7 example that google points to here, but it doesn't work. There is no setup of taskqueue, no requirements.txt, no instructions.

There is a stack overflow question on this topic here, and the checked answer says to install the SDK. That takes you to here, which takes you to here, which takes you here, which takes you to here, which provides the gcloud SDK download for deploying and managing gcloud. This does not include the python lib for taskqueue.

There is another similar stackoverflow question here, which says: enter image description here ... this is now starting to feel like an infinite loop. Yes, it's been made crystal clear you need to import the taskqueue. But how do you make it available?

I've asked the question to Google Support and they haven't been able to answer for 4 days.

I've opened two issues, one here and another here. No answers yet.

Do not want to use Python < 3.4.

Do not want to use HTTP REST API.

Just want a simple pull queue.

Upvotes: 0

Views: 286

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39834

Many of the docs you mentioned are standard environment docs and do not apply to the flexible environment.

From the Task Queue section in Migrating Services from the Standard Environment to the Flexible Environment:

The Task Queue service has limited availability outside of the standard environment. If you want to use the service outside of the standard environment, you can sign up for the Cloud Tasks alpha.

Outside of the standard environment, you can't add tasks to push queues, but a service running in the flexible environment can be the target of a push task. You can specify this using the target parameter when adding a task to queue or by specifying the default target for the queue in queue.yaml.

In many cases where you might use pull queues, such as queuing up tasks or messages that will be pulled and processed by separate workers, Cloud Pub/Sub can be a good alternative as it offers similar functionality and delivery guarantees.

Upvotes: 1

Related Questions