Created
February 21, 2010 01:12
-
-
Save djmitche/310039 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| from twisted.python import threadpool | |
| from twisted.internet import threads | |
| from twisted.trial import unittest | |
| class t(unittest.TestCase): | |
| def setUp(self): | |
| self.pool = threadpool.ThreadPool(3, 5) | |
| self.pool.start() | |
| def tearDown(self): | |
| print list(threading.enumerate()) | |
| def testit(self): | |
| from twisted.internet import reactor | |
| return threads.deferToThreadPool(reactor, self.pool, lambda : True) | |
| def testit2(self): | |
| return self.testit() | |
| def testit3(self): | |
| return self.testit() | |
| def testit4(self): | |
| return self.testit() | |
| def testit5(self): | |
| return self.testit() | |
| def testit6(self): | |
| return self.testit() | |
| def testit7(self): | |
| return self.testit() | |
| def testit8(self): | |
| return self.testit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment