Added better xpath selectors for the UI elements
This commit is contained in:
@@ -32,12 +32,13 @@ topic_path = publisher.topic_path(project_id, topic_name)
|
||||
|
||||
# Create a Pub/Sub subscription
|
||||
subscriber = pubsub_v1.SubscriberClient()
|
||||
'''
|
||||
subscription_name = "fp-subscription-zipcodes"
|
||||
subscription_path = subscriber.subscription_path(project_id, subscription_name)
|
||||
subscription = subscriber.create_subscription(
|
||||
name=subscription_path, topic=topic_path
|
||||
)
|
||||
|
||||
'''
|
||||
# Publish a message to the topic
|
||||
# Read the data from the csv file
|
||||
file_path = "C:/Users/Karen/Desktop/zipcodes.csv"
|
||||
@@ -51,11 +52,12 @@ with open(file_path, "r") as csv_file:
|
||||
future = publisher.publish(topic_path, data)
|
||||
print(f"Published message ID {future.result()}")
|
||||
|
||||
|
||||
'''
|
||||
async def receive_messages():
|
||||
response = subscriber.pull(subscription=subscription_path, max_messages=1)
|
||||
for received_message in response.received_messages:
|
||||
print("Received message: {}".format(received_message.message.data))
|
||||
|
||||
|
||||
asyncio.run(receive_messages())
|
||||
asyncio.run(receive_messages())
|
||||
'''
|
||||
Reference in New Issue
Block a user