-
-
Save raybotha/d4df2d69c12d86ce357a6bd0785cdbdc to your computer and use it in GitHub Desktop.
GT debugging nameko
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
from google.cloud import pubsub_v1 | |
from time import sleep | |
import eventlet | |
eventlet.monkey_patch() | |
publisher = pubsub_v1.PublisherClient() | |
topic_path = publisher.topic_path("proj", "topic") | |
def run(): | |
for i in range(1000): | |
publisher.publish(topic_path, data=str(i).encode("utf-8")) | |
sleep(1) | |
print("heyo") | |
for i in range(100): | |
eventlet.greenthread.spawn_n(run) | |
while True: | |
sleep(10) | |
print("10s elapsed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment