Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/c/o/concurrence-HEAD/test/testcore.py   concurrence(Download)
 
        for i in range(10):
            looper_channel.send(i)
        self.assertEqual(range(10), recvd)
 
        self.assertEqual(-1, looper_channel.balance)
 
        self.assertTrue(looper_task.alive)
 
        looper_channel.send(None) #will trigger exception loop
        recvd = []
        for i in range(10):
            looper_channel.send(i)
        self.assertEqual(range(10), recvd)
 
        tl = Tasklet.later(1.0, test_channel.receive)()
        try:            
            test_channel.send(10, 2.0)
        except TimeoutError:
            self.fail('did not expect timeout')
        tl = Tasklet.later(2.0, test_channel.receive)()
        try:            
            test_channel.send(10, 1.0)
            self.fail('expected timeout')
        except TimeoutError:

src/c/o/concurrence-HEAD/test/testtimer.py   concurrence(Download)
        def sender(times):
            for i in range(times):
                Tasklet.sleep(1.0)
                ch.send(True)