From fcdea37dd8f90f46ff99b10cb3e9cc4f9b5374d9 Mon Sep 17 00:00:00 2001 From: L J Date: Wed, 17 Jan 2018 12:45:33 -0500 Subject: [PATCH 1/5] Update subscriber.py --- pubsub/cloud-client/subscriber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 577e77cb9e6e..4737bb8564c3 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -124,7 +124,7 @@ def callback(message): # Blocks the thread while messages are coming in through the stream. Any # exceptions that crop up on the thread will be set on the future. - future = subscription.open(callback) + future = subscription.future(callback) try: future.result() except Exception as e: From 4946c9fe6edfe3b8b4c18959635a37768f82c52b Mon Sep 17 00:00:00 2001 From: L J Date: Wed, 17 Jan 2018 12:47:29 -0500 Subject: [PATCH 2/5] Update subscriber.py --- pubsub/cloud-client/subscriber.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 4737bb8564c3..815e2d5b05ae 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -120,11 +120,11 @@ def callback(message): print('Received message: {}'.format(message)) message.ack() - subscription = subscriber.subscribe(subscription_path, callback=callback) + subscription = client.subscribe(subscription_path, callback=callback) # Blocks the thread while messages are coming in through the stream. Any # exceptions that crop up on the thread will be set on the future. - future = subscription.future(callback) + future = subscription.open(callback) try: future.result() except Exception as e: From 358fe09fb285935902125d50b7cedb2c3ed8df32 Mon Sep 17 00:00:00 2001 From: L J Date: Wed, 17 Jan 2018 12:48:57 -0500 Subject: [PATCH 3/5] Update subscriber.py --- pubsub/cloud-client/subscriber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 815e2d5b05ae..84daf7fdcf88 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -126,7 +126,7 @@ def callback(message): # exceptions that crop up on the thread will be set on the future. future = subscription.open(callback) try: - future.result() + subscription.future.result() except Exception as e: print( 'Listening for messages on {} threw an Exception: {}.'.format( From 9b5a7dbc8f3e2a5c9fa5fba511eb593cf65323ba Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Wed, 17 Jan 2018 10:10:28 -0800 Subject: [PATCH 4/5] Update subscriber.py --- pubsub/cloud-client/subscriber.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 84daf7fdcf88..43913ff5f291 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -124,7 +124,6 @@ def callback(message): # Blocks the thread while messages are coming in through the stream. Any # exceptions that crop up on the thread will be set on the future. - future = subscription.open(callback) try: subscription.future.result() except Exception as e: From e116aa46b1846e1a8ee89672148e8d1d0789d520 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Wed, 17 Jan 2018 10:22:44 -0800 Subject: [PATCH 5/5] Update subscriber.py --- pubsub/cloud-client/subscriber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubsub/cloud-client/subscriber.py b/pubsub/cloud-client/subscriber.py index 43913ff5f291..1fd480e59a21 100644 --- a/pubsub/cloud-client/subscriber.py +++ b/pubsub/cloud-client/subscriber.py @@ -120,7 +120,7 @@ def callback(message): print('Received message: {}'.format(message)) message.ack() - subscription = client.subscribe(subscription_path, callback=callback) + subscription = subscriber.subscribe(subscription_path, callback=callback) # Blocks the thread while messages are coming in through the stream. Any # exceptions that crop up on the thread will be set on the future.