aboutsummaryrefslogtreecommitdiffstats
path: root/examples/nonblocking.py
blob: ed8cc7c9561b22c4a3cda1e601c1535642094ab5 (plain)
1
2
3
4
5
6
7
8
import time
from libmproxy.script import concurrent

@concurrent
def request(context, flow):
    print "handle request: %s%s" % (flow.request.host, flow.request.path)
    time.sleep(5)
    print "start  request: %s%s" % (flow.request.host, flow.request.path)