From 0b162eba183b9c290deff8b962631e151fc2dd2f Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 11 Dec 2018 23:41:38 +0000 Subject: [PATCH] examples: tidy up comments --- examples/select_loop.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/select_loop.py b/examples/select_loop.py index 414bb358..bc9d9802 100644 --- a/examples/select_loop.py +++ b/examples/select_loop.py @@ -33,7 +33,9 @@ def main(router): for i in range(5) } - # Used later to recover hostname from failed call. + # Used later to recover hostname. A future Mitogen will provide a better + # way to get app data references back out of its IO primitives, for now you + # need to do it manually. hostname_by_context_id = { context.context_id: hostname for hostname, context in contexts.items() @@ -60,11 +62,14 @@ def main(router): ) # Create a select subscribed to the function call result Select, and to the - # number-counting receiver. + # number-counting receiver. Any message arriving on any child of this + # Select will wake it up -- be it a message arriving on the status + # receiver, or any message arriving on any of the function call result + # receivers. both_sel = mitogen.select.Select([status_recv, calls_sel], oneshot=False) - # Once last call is completed, calls will be empty since it's oneshot=True - # (the default), causing __bool__ to be False + # Once last call is completed, calls_sel will be empty since it's + # oneshot=True (the default), causing __bool__ to be False while calls_sel: try: msg = both_sel.get(timeout=60.0)