Skip to content

Instantly share code, notes, and snippets.

@raybotha
Created March 13, 2018 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raybotha/d4df2d69c12d86ce357a6bd0785cdbdc to your computer and use it in GitHub Desktop.
Save raybotha/d4df2d69c12d86ce357a6bd0785cdbdc to your computer and use it in GitHub Desktop.
GT debugging nameko
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