Clarified docs on spawn_n's semantics.

This commit is contained in:
Ryan Williams
2010-03-29 00:08:03 -07:00
parent 11e6793e53
commit b35c488ff7
2 changed files with 10 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ Greenthread Spawn
.. function:: eventlet.spawn_n(func, *args, **kw) .. 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 <eventlet.greenthread.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 <eventlet.greenthread.spawn_n>` for more details.
.. function:: eventlet.spawn_after(seconds, func, *args, **kw) .. function:: eventlet.spawn_after(seconds, func, *args, **kw)

View File

@@ -54,9 +54,15 @@ def _main_wrapper(func, args, kwargs):
def spawn_n(func, *args, **kwargs): def spawn_n(func, *args, **kwargs):
"""Same as :func:`spawn`, but returns a ``greenlet`` object from which it is """Same as :func:`spawn`, but returns a ``greenlet`` object from
not possible to retrieve the results. This is faster than :func:`spawn`; which it is not possible to retrieve either a return value or
it is fastest if there are no keyword arguments.""" 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] return _spawn_n(0, func, args, kwargs)[1]