(func, name_suffix="")
| 124 | daemons = [] |
| 125 | |
| 126 | def factory(func, name_suffix=""): |
| 127 | name = func.__name__ + name_suffix |
| 128 | thread = threading.Thread(target=func, name=name) |
| 129 | thread.daemon = True |
| 130 | daemons.append(thread) |
| 131 | thread.start() |
| 132 | return thread |
| 133 | |
| 134 | yield factory |
| 135 |