diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-09-14 11:30:00 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-09-14 11:30:00 +1200 |
commit | 81e3a6e8e661b212bf45fb37623556f2793d2184 (patch) | |
tree | f0fdb3d88bce83263fa91b5a0000093f335d865f /libmproxy/controller.py | |
parent | 7b74d207f39e642e5029a4855da47314ce224a33 (diff) | |
download | mitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.tar.gz mitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.tar.bz2 mitmproxy-81e3a6e8e661b212bf45fb37623556f2793d2184.zip |
Super-basic outline for web io loop
Diffstat (limited to 'libmproxy/controller.py')
-rw-r--r-- | libmproxy/controller.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libmproxy/controller.py b/libmproxy/controller.py index 4a72cf80..c71088cb 100644 --- a/libmproxy/controller.py +++ b/libmproxy/controller.py @@ -89,7 +89,7 @@ class Master: self.masterq = Queue.Queue() self.should_exit = threading.Event() - def tick(self, q): + def tick(self, q, timeout): changed = False try: # This endless loop runs until the 'Queue.Empty' @@ -97,8 +97,7 @@ class Master: # the queue, this speeds up every request by 0.1 seconds, # because get_input(..) function is not blocking. while True: - # Small timeout to prevent pegging the CPU - msg = q.get(timeout=0.01) + msg = q.get(timeout=timeout) self.handle(*msg) changed = True except Queue.Empty: |