From b35c488ff7b6fb9e59d5f76b40a8c570dbfbb81b Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 29 Mar 2010 00:08:03 -0700 Subject: [PATCH] Clarified docs on spawn_n's semantics. --- doc/basic_usage.rst | 2 +- eventlet/greenthread.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/basic_usage.rst b/doc/basic_usage.rst index db242b3..f33a7aa 100644 --- a/doc/basic_usage.rst +++ b/doc/basic_usage.rst @@ -24,7 +24,7 @@ Greenthread Spawn .. function:: eventlet.spawn_n(func, *args, **kw) - The same as :func:`spawn`, but it's not possible to retrieve the return value. This makes execution faster. See :func:`spawn_n ` for more details. + The same as :func:`spawn`, but it's not possible to know how the function terminated (i.e. no return value or exceptions). This makes execution faster. See :func:`spawn_n ` for more details. .. function:: eventlet.spawn_after(seconds, func, *args, **kw) diff --git a/eventlet/greenthread.py b/eventlet/greenthread.py index 7bcaf93..65cb045 100644 --- a/eventlet/greenthread.py +++ b/eventlet/greenthread.py @@ -54,9 +54,15 @@ def _main_wrapper(func, args, kwargs): def spawn_n(func, *args, **kwargs): - """Same as :func:`spawn`, but returns a ``greenlet`` object from which it is - not possible to retrieve the results. This is faster than :func:`spawn`; - it is fastest if there are no keyword arguments.""" + """Same as :func:`spawn`, but returns a ``greenlet`` object from + which it is not possible to retrieve either a return value or + whether it raised any exceptions. This is faster than + :func:`spawn`; it is fastest if there are no keyword arguments. + + If an exception is raised in the function, spawn_n prints a stack + trace; the print can be disabled by calling + :func:`eventlet.debug.hub_exceptions` with False. + """ return _spawn_n(0, func, args, kwargs)[1]