summaryrefslogtreecommitdiff
path: root/test/git/async
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-10 14:39:57 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-10 14:39:57 +0200
commit55e757928e493ce93056822d510482e4ffcaac2d (patch)
tree292bc4fac0e4daef4c39109c752b241684d8c48e /test/git/async
parent01eac1a959c1fa5894a86bf11e6b92f96762bdd8 (diff)
downloadgitpython-55e757928e493ce93056822d510482e4ffcaac2d.tar.gz
channel: Changed design to be more logical - a channel now has any amount of readers and writers, a ready is not connected to its writer anymore. This changes the refcounting of course, which is why the auto-cleanup for the pool is currently broken.
The benefit of this are faster writes to the channel, reading didn't improve, refcounts should be clearer now
Diffstat (limited to 'test/git/async')
-rw-r--r--test/git/async/test_channel.py6
-rw-r--r--test/git/async/test_pool.py5
2 files changed, 6 insertions, 5 deletions
diff --git a/test/git/async/test_channel.py b/test/git/async/test_channel.py
index 215081cd..a24c7c91 100644
--- a/test/git/async/test_channel.py
+++ b/test/git/async/test_channel.py
@@ -9,8 +9,8 @@ class TestChannels(TestBase):
def test_base(self):
# creating channel yields a write and a read channal
wc, rc = mkchannel()
- assert isinstance(wc, WChannel) # default args
- assert isinstance(rc, RChannel)
+ assert isinstance(wc, Writer) # default args
+ assert isinstance(rc, Reader)
# TEST UNLIMITED SIZE CHANNEL - writing+reading is FIFO
@@ -46,7 +46,7 @@ class TestChannels(TestBase):
# test callback channels
- wc, rc = mkchannel(wctype = CallbackWChannel, rctype = CallbackRChannel)
+ wc, rc = mkchannel(wtype = CallbackWriter, rtype = CallbackReader)
cb = [0, 0] # set slots to one if called
def pre_write(item):
diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py
index 679bab31..d34f6773 100644
--- a/test/git/async/test_pool.py
+++ b/test/git/async/test_pool.py
@@ -191,8 +191,8 @@ class TestThreadPool(TestBase):
assert p.num_tasks() == null_tasks
rc = p.add_task(task)
assert p.num_tasks() == 1 + null_tasks
- assert isinstance(rc, RPoolChannel)
- assert task._out_wc is not None
+ assert isinstance(rc, PoolReader)
+ assert task._out_writer is not None
# pull the result completely - we should get one task, which calls its
# function once. In sync mode, the order matches
@@ -460,6 +460,7 @@ class TestThreadPool(TestBase):
# order of deletion doesnt matter
del(ts)
del(rcs)
+ print pool.num_tasks()
assert pool.num_tasks() == null_tasks