Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
# appengine_config.py
from google.appengine.ext import vendor
# Add any libraries install in the "lib" folder.
vendor.add('lib')
cron:
- description: "regular job"
url: /watch
schedule: every 1 hours
import webapp2
from google.cloud import pubsub
class WatchPage(webapp2.RequestHandler):
def get(self):
pubsub_client = pubsub.Client()
topic = pubsub_client.topic('timer-topic')
message_id = topic.publish('ping'.encode('utf-8'))
self.response.write(message_id)
app = webapp2.WSGIApplication([
('/watch', WatchPage),
], debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment