nemubot/modules/soutenance/Delayed.py

14 lines
227 B
Python
Raw Normal View History

2012-06-30 02:06:59 +00:00
# coding=utf-8
import threading
class Delayed:
def __init__(self, name):
self.name = name
self.res = None
self.evt = threading.Event()
def wait(self, timeout):
self.evt.clear()
self.evt.wait(timeout)