Created
July 11, 2018 00:11
-
-
Save gguuss/61cb9290fe57a7c49a93f2c149752577 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def pubsub_callback(message): | |
messages.append(message.data) | |
message.ack() | |
app.logger.info(message.data) | |
@app.before_request | |
def before_first_request(): | |
subscriber = pubsub_v1.SubscriberClient() | |
subscription_path = subscriber.subscription_path(PROJECT_ID, subscription_name) | |
#subscriber.subscribe_experimental(subscription_name, pubsub_callback) | |
app.logger.info(subscription_path) | |
app.logger.info(dir(app)) | |
subscriber.subscribe(subscription_path, pubsub_callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment