예제 #1
0
파일: test_future.py 프로젝트: findepi/pymx
def test_threaded_future():
    f = Future()
    def setter():
        sleep(0.01)
        f.set(13)

    th = TestThread(target=setter)
    th.setDaemon(True)
    th.start()

    eq_(f.wait(1), 13)
    eq_(f.value, 13)
    th.join()
예제 #2
0
파일: test_future.py 프로젝트: findepi/pymx
def test_simple_future():
    f = Future()
    f.set(3)
    eq_(f.wait(4), 3)
    eq_(f.wait(4), 3)