Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created November 26, 2018 05:47
Show Gist options
  • Save nad2000/e8f034ed83be2809726859d5656b97c2 to your computer and use it in GitHub Desktop.
Save nad2000/e8f034ed83be2809726859d5656b97c2 to your computer and use it in GitHub Desktop.
queue and threading demo
from time import sleep
from queue import Queue
from threading import Thread
q = Queue(2)
Thread(target=lambda:(sleep(10), q.put(42))).start()
q.get()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment