diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-06-08 11:21:38 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-06-08 11:21:38 +1200 |
commit | b3bf754e539555351230cbb0887f8838c12fd23c (patch) | |
tree | 862b77357a28b85472bb48387e98e1d3519b625e /examples/nonblocking.py | |
parent | a388ddfd781fd05a414c07cac8446ef151cbd1d2 (diff) | |
download | mitmproxy-b3bf754e539555351230cbb0887f8838c12fd23c.tar.gz mitmproxy-b3bf754e539555351230cbb0887f8838c12fd23c.tar.bz2 mitmproxy-b3bf754e539555351230cbb0887f8838c12fd23c.zip |
Simplify script concurrency helpers
We now have take() to prevent double-replies.
Diffstat (limited to 'examples/nonblocking.py')
-rw-r--r-- | examples/nonblocking.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nonblocking.py b/examples/nonblocking.py index 41674b2a..4609f389 100644 --- a/examples/nonblocking.py +++ b/examples/nonblocking.py @@ -4,6 +4,6 @@ from mitmproxy.script import concurrent @concurrent # Remove this and see what happens def request(context, flow): - print("handle request: %s%s" % (flow.request.host, flow.request.path)) + context.log("handle request: %s%s" % (flow.request.host, flow.request.path)) time.sleep(5) - print("start request: %s%s" % (flow.request.host, flow.request.path)) + context.log("start request: %s%s" % (flow.request.host, flow.request.path)) |