]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
util/limiter: add a repr
authorBrian Warner <warner@allmydata.com>
Tue, 7 Oct 2008 20:19:45 +0000 (13:19 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 7 Oct 2008 20:19:45 +0000 (13:19 -0700)
src/allmydata/util/limiter.py

index aaee2c7d0bdbdccba543d32a6fe6d2e96d049ebb..d3222a7b41a24d9723ea74503dcd07d8fd50c697 100644 (file)
@@ -13,6 +13,10 @@ class ConcurrencyLimiter:
         self.pending = []
         self.active = 0
 
+    def __repr__(self):
+        return "<Limiter with %d/%d/%d>" % (self.active, len(self.pending),
+                                            self.limit)
+
     def add(self, cb, *args, **kwargs):
         d = defer.Deferred()
         task = (cb, args, kwargs, d)