예제 #1
0
    def test_send (self):
        event1 = Event()
        event2 = Event()

        spawn(event1.send, 'hello event1')
        Timeout(0, ValueError('interrupted'))
        try:
            result = event1.wait()
        except ValueError:
            X = object()
            result = with_timeout(DELAY, event2.wait, timeout_value = X)
            assert result is X, 'Nobody sent anything to event2 yet it received %r' % (result, )
예제 #2
0
 def func():
     return with_timeout(0.2, sleep, 2, timeout_value=1)
예제 #3
0
 def func ():
     return with_timeout(0.2, sleep, 2, timeout_value = 1)