From 718417d347fde625e08d835c6070b38e61efb16d Mon Sep 17 00:00:00 2001 From: Jeff Mendoza Date: Tue, 12 Apr 2016 13:54:07 -0700 Subject: [PATCH] App Engine Task Queue example using pull queues. Copied from: https://github.com/GoogleCloudPlatform/appengine-pullqueue-counter and tests added. --- .../counter/{main_test.py => counter_test.py} | 0 appengine/taskqueue/pull-counter/README.md | 8 ++ appengine/taskqueue/pull-counter/app.yaml | 11 +++ appengine/taskqueue/pull-counter/counter.html | 15 ++++ appengine/taskqueue/pull-counter/main.py | 84 +++++++++++++++++++ .../pull-counter/pullcounter_test.py | 33 ++++++++ appengine/taskqueue/pull-counter/queue.yaml | 3 + appengine/taskqueue/pull-counter/worker.yaml | 15 ++++ 8 files changed, 169 insertions(+) rename appengine/taskqueue/counter/{main_test.py => counter_test.py} (100%) create mode 100644 appengine/taskqueue/pull-counter/README.md create mode 100644 appengine/taskqueue/pull-counter/app.yaml create mode 100644 appengine/taskqueue/pull-counter/counter.html create mode 100644 appengine/taskqueue/pull-counter/main.py create mode 100644 appengine/taskqueue/pull-counter/pullcounter_test.py create mode 100644 appengine/taskqueue/pull-counter/queue.yaml create mode 100644 appengine/taskqueue/pull-counter/worker.yaml diff --git a/appengine/taskqueue/counter/main_test.py b/appengine/taskqueue/counter/counter_test.py similarity index 100% rename from appengine/taskqueue/counter/main_test.py rename to appengine/taskqueue/counter/counter_test.py diff --git a/appengine/taskqueue/pull-counter/README.md b/appengine/taskqueue/pull-counter/README.md new file mode 100644 index 000000000000..ac634800a729 --- /dev/null +++ b/appengine/taskqueue/pull-counter/README.md @@ -0,0 +1,8 @@ +# App Engine Task Queue Pull Counter + + +These samples are used on the following documentation page: + +> https://cloud.google.com/appengine/docs/python/taskqueue/overview-pull + + diff --git a/appengine/taskqueue/pull-counter/app.yaml b/appengine/taskqueue/pull-counter/app.yaml new file mode 100644 index 000000000000..e2b5e55709c0 --- /dev/null +++ b/appengine/taskqueue/pull-counter/app.yaml @@ -0,0 +1,11 @@ +runtime: python27 +api_version: 1 +threadsafe: true + +handlers: +- url: /.* + script: main.app + +libraries: +- name: jinja2 + version: 2.6 diff --git a/appengine/taskqueue/pull-counter/counter.html b/appengine/taskqueue/pull-counter/counter.html new file mode 100644 index 000000000000..a9f6a39d3609 --- /dev/null +++ b/appengine/taskqueue/pull-counter/counter.html @@ -0,0 +1,15 @@ + + + +
+ + +
+