From 76a7883c8b7651e7078ba351ea4675bb0bd0f3db Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 8 May 2018 11:09:10 +1200 Subject: events: document behaviour of done() more fully --- examples/addons/events.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/addons/events.py b/examples/addons/events.py index cd714ba0..f83c8f11 100644 --- a/examples/addons/events.py +++ b/examples/addons/events.py @@ -142,8 +142,12 @@ class Events: def done(self): """ - Called when the addon shuts down, either by being removed from the - mitmproxy instance, or when mitmproxy itself shuts down. + Called when the addon shuts down, either by being removed from + the mitmproxy instance, or when mitmproxy itself shuts down. On + shutdown, this event is called after the event loop is + terminated, guaranteeing that it will be the final event an addon + sees. Note that log handlers are shut down at this point, so + calls to log functions will produce no output. """ def load(self, entry: mitmproxy.addonmanager.Loader): -- cgit v1.2.3