aboutsummaryrefslogtreecommitdiffstats
path: root/test/scripts/concurrent_decorator.py
blob: 8e132006757839bc43df2ce9a1659a2c4bb0c7fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import time
from libmproxy.script import concurrent


@concurrent
def clientconnect(context, cc):
    context.log("clientconnect")


@concurrent
def serverconnect(context, sc):
    context.log("serverconnect")


@concurrent
def request(context, flow):
    time.sleep(0.1)


@concurrent
def response(context, flow):
    context.log("response")


@concurrent
def error(context, err):
    context.log("error")


@concurrent
def clientdisconnect(context, dc):
    context.log("clientdisconnect")