doc: hubs: update link to common.txt (note on internal API functions)

This commit is contained in:
Sergey Shepelev
2013-01-08 05:17:57 +04:00
parent 0fae54f808
commit d4565ee6a0

View File

@@ -11,19 +11,19 @@ _threadlocal = threading.local()
def get_default_hub(): def get_default_hub():
"""Select the default hub implementation based on what multiplexing """Select the default hub implementation based on what multiplexing
libraries are installed. The order that the hubs are tried is: libraries are installed. The order that the hubs are tried is:
* twistedr * twistedr
* epoll * epoll
* poll * poll
* select * select
It won't automatically select the pyevent hub, because it's not It won't automatically select the pyevent hub, because it's not
python-thread-safe. python-thread-safe.
.. include:: ../../doc/common.txt .. include:: ../doc/common.txt
.. note :: |internal| .. note :: |internal|
""" """
# pyevent hub disabled for now because it is not thread-safe # pyevent hub disabled for now because it is not thread-safe
#try: #try:
# import eventlet.hubs.pyevent # import eventlet.hubs.pyevent
@@ -46,13 +46,13 @@ def get_default_hub():
def use_hub(mod=None): def use_hub(mod=None):
"""Use the module *mod*, containing a class called Hub, as the """Use the module *mod*, containing a class called Hub, as the
event hub. Usually not required; the default hub is usually fine. event hub. Usually not required; the default hub is usually fine.
Mod can be an actual module, a string, or None. If *mod* is a module, Mod can be an actual module, a string, or None. If *mod* is a module,
it uses it directly. If *mod* is a string, use_hub tries to import it uses it directly. If *mod* is a string, use_hub tries to import
`eventlet.hubs.mod` and use that as the hub module. If *mod* is None, `eventlet.hubs.mod` and use that as the hub module. If *mod* is None,
use_hub uses the default hub. Only call use_hub during application use_hub uses the default hub. Only call use_hub during application
initialization, because it resets the hub's state and any existing initialization, because it resets the hub's state and any existing
timers or listeners will never be resumed. timers or listeners will never be resumed.
""" """
if mod is None: if mod is None:
@@ -71,7 +71,7 @@ def use_hub(mod=None):
def get_hub(): def get_hub():
"""Get the current event hub singleton object. """Get the current event hub singleton object.
.. note :: |internal| .. note :: |internal|
""" """
try: try:
@@ -85,7 +85,7 @@ def get_hub():
return hub return hub
from eventlet import timeout from eventlet import timeout
def trampoline(fd, read=None, write=None, timeout=None, def trampoline(fd, read=None, write=None, timeout=None,
timeout_exc=timeout.Timeout): timeout_exc=timeout.Timeout):
"""Suspend the current coroutine until the given socket object or file """Suspend the current coroutine until the given socket object or file
descriptor is ready to *read*, ready to *write*, or the specified descriptor is ready to *read*, ready to *write*, or the specified
@@ -98,7 +98,7 @@ def trampoline(fd, read=None, write=None, timeout=None,
If the specified *timeout* elapses before the socket is ready to read or If the specified *timeout* elapses before the socket is ready to read or
write, *timeout_exc* will be raised instead of ``trampoline()`` write, *timeout_exc* will be raised instead of ``trampoline()``
returning normally. returning normally.
.. note :: |internal| .. note :: |internal|
""" """
t = None t = None