Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taskqueue lib is advertised but not available nor explained in docs #3834

Closed
robertjchristian opened this issue Aug 17, 2017 · 6 comments
Closed
Assignees

Comments

@robertjchristian
Copy link

robertjchristian commented Aug 17, 2017

How does one make the taskqueue lib available in Python 3.4?

  1. OS type and version - All
  2. Python version and virtual environment information python --version Python 3.4
  3. google-cloud-python version pip show google-cloud, pip show google-<service> or pip freezegoogle-cloud==0.27.0
  4. Stacktrace if available:
    from google.appengine.api import taskqueue
    ModuleNotFoundError: No module named 'google.appengine'
  5. Steps to reproduce:
  • Follow any google example or documentation on using task pull queue.
  • pip install google-cloud
  • Include import statement as specified: from google.appengine.api import taskqueue
  • See that taskqueue is not available.
  • Review 20+ outstanding google docs and code examples relating to task pull queues. Find that not one explains how to make this lib available to python 3.4.
  • Google for this error online. See that there is a lot of confusion around this particular lib. See that there are several stack overflow questions on this with no clear answer.
  1. Code example
    https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/taskqueue/pull-counter or anything else online by google regarding task queue. Not a single example explains how to make this lib available for python 3.4 app engine flex.
@duggelz
Copy link

duggelz commented Aug 17, 2017

Unfortunately, the task queue service is not available in the App Engine Flexible environment yet. We will update the migration doc to more clearly state this limitation.

CC @jonparrott @andrewsg

@theacodes
Copy link
Contributor

As @duggelz said, there's not currently a task queue library for use outside of the app engine standard environment.

However, as per the migration doc you can make an App Engine flex service the target of a push queue task that's enqueued from an App Engine standard service.

Let us know if you have any other questions.

@robertjchristian
Copy link
Author

Thank you. I do have a question. How would I create a pull queue from pub sub to process 5 worker threads concurrently?

Here's additional context on the question:

https://stackoverflow.com/questions/45745967/how-to-setup-a-concurrent-worker-pool-in-python-3-4-using-gcp-pubsub

If using Python thread pool makes sense, how would I drive it from within App Engine? With a main() or is there a known way to run alongside gunicorn or similar so that it can also support rest?

@theacodes
Copy link
Contributor

Our pubsub client is poised to change quite a bit soon, but, our Bookshelf Pub/Sub tutorial shows how to use Pub/Sub to do worker queues: https://cloud.google.com/python/getting-started/using-pub-sub

@robertjchristian
Copy link
Author

Thank you. https://cloud.google.com/python/getting-started/using-pub-sub is absolutely what I was looking for!

@mike-seekwell
Copy link

mike-seekwell commented Jan 4, 2018

Any timeline on this? I just spent several hours researching and implementing this only to find you can't use it with Python3. Or can someone at least approve my request for Cloud Tasks API Alpha?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants