diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-10 00:24:49 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-10 00:24:49 +0200 |
commit | 3323464f85b986cba23176271da92a478b33ab9c (patch) | |
tree | 1633f83f6c5fd5a98396fc925b44602282cbd15a /lib/git/async/task.py | |
parent | 257a8a9441fca9a9bc384f673ba86ef5c3f1715d (diff) | |
download | gitpython-3323464f85b986cba23176271da92a478b33ab9c.tar.gz |
messy first version of a properly working depth-first graph method, which allows the pool to work as expected. Many more tests need to be added, and there still is a problem with shutdown as sometimes it won't kill all threads, mainly because the process came up with worker threads started, which cannot be
Diffstat (limited to 'lib/git/async/task.py')
-rw-r--r-- | lib/git/async/task.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/git/async/task.py b/lib/git/async/task.py index 03b40492..57dd285d 100644 --- a/lib/git/async/task.py +++ b/lib/git/async/task.py @@ -80,7 +80,9 @@ class OutputChannelTask(Node): def process(self, count=0): """Process count items and send the result individually to the output channel""" + print "%r: reading %i" % (self.id, count) items = self._read(count) + print "%r: done reading" % self.id try: # increase the ref-count - we use this to determine whether anyone else # is currently handling our output channel. As this method runs asynchronously, @@ -102,7 +104,7 @@ class OutputChannelTask(Node): wc.write(rval) # END handle single apply except Exception, e: - print >> sys.stderr, "task error:", str(e) # TODO: REMOVE DEBUG, or make it use logging + print >> sys.stderr, "task %s error:" % self.id, type(e), str(e) # TODO: REMOVE DEBUG, or make it use logging # be sure our task is not scheduled again self.set_done() @@ -146,6 +148,7 @@ class OutputChannelTask(Node): # thread having its copy on the stack # + 1 for the instance we provide to refcount if self.is_done() and getrefcount(self._out_wc) < 4: + print "Closing channel of %r" % self.id self.close() # END handle channel closure #{ Configuration |