Created
May 26, 2017 04:55
-
-
Save mhaligowski/e1c420fcb3cc7d2df92a0cd7e4de5dfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runtime: python27 | |
api_version: 1 | |
threadsafe: true | |
handlers: | |
- url: /.* | |
script: main.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# appengine_config.py | |
from google.appengine.ext import vendor | |
# Add any libraries install in the "lib" folder. | |
vendor.add('lib') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cron: | |
- description: "regular job" | |
url: /watch | |
schedule: every 1 hours | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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