1import threading
2import queue
3
4my_queue = queue.Queue()
5
6def storeInQueue(f):
7 def wrapper(*args):
8 my_queue.put(f(*args))
9 return wrapper
10
11
12@storeInQueue
13def get_name(full_name):
14 return full_name, full_name
15
16
17
18t = threading.Thread(target=get_name, args = ("foo", ))
19t.start()
20
21my_data = my_queue.get()
22print(my_data)
23