Skip to content

Instantly share code, notes, and snippets.

@mhaligowski
Created May 26, 2017 04:55
Show Gist options
  • Save mhaligowski/e1c420fcb3cc7d2df92a0cd7e4de5dfa to your computer and use it in GitHub Desktop.
Save mhaligowski/e1c420fcb3cc7d2df92a0cd7e4de5dfa to your computer and use it in GitHub Desktop.
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