gevent API reference
100 public APIs from gevent (gevent/gevent) — 58 classes, 9 functions, 33 methods. Signatures extracted by static analysis of the actual source.
Repository: gevent/gevent
| Kind | Count |
|---|---|
| Classes | 58 |
| Functions | 9 |
| Methods | 33 |
API list
func
_setuputils.read(*names)Read a file path relative to this file.
class
src.gevent._config.ConfigGlobal configuration for gevent.
func
src.gevent._config.validate_bool(value)This is a boolean value.
class
src.gevent._ffi.watcher.AbstractWatcherTypeBase metaclass for watchers.
class
src.gevent._ffi.watcher.ResourceWarningPython 2 fallback
class
src.gevent._fileobjectcommon.FileIOA subclass that we can dynamically assign __class__ for.
class
src.gevent._fileobjectcommon.OpenDescriptorInterprets the arguments to `open`.
func
src.gevent._hub_local.get_hub()Return the hub for the current thread.
func
src.gevent._hub_local.get_hub_class()Return the type of hub to use for the current thread.
func
src.gevent._hub_local.get_hub_if_exists()Return the hub for the current thread.
class
src.gevent._ident.ValuedWeakRefA weak ref with an associated value.
class
src.gevent._imap.IMapUnorderedAt iterator of map results.
method
src.gevent._interfaces.ICallback.close()An alias of `stop`.
class
src.gevent._interfaces.ILoopThe common interface expected for all event loops.
method
src.gevent._interfaces.ILoop.destroy()Clean up resources used by this loop.
method
src.gevent._interfaces.ILoop.run(once=False)Run the event loop.
class
src.gevent._interfaces.IWatcherAn event loop watcher.
class
src.gevent._monitor.MonitorWarningThe type of warnings we emit.
class
src.gevent._patcher.cached_platform_architectureContext manager that caches ``platform.architecture``.
class
src.gevent._semaphore.SemaphoreSemaphore(value=1) -> Semaphore ..
class
src.gevent._tblib.TracebackClass that wraps builtin Traceback objects.
method
src.gevent._tblib.Traceback.as_dict()Converts to a dictionary representation.
class
src.gevent._threading.QueueCreate a queue object.
method
src.gevent._threading.Queue.kill()Call to destroy this object.
method
src.gevent._threading.Queue.put(item)Put an item into the queue.
class
src.gevent._util.LazyA non-data descriptor used just like @property.
class
src.gevent._util.LazyOnClassSimilar to `Lazy`, but stores the value in the class.
class
src.gevent._util.readpropertyA non-data descriptor similar to :class:`property`.
class
src.gevent._waiter.WaiterA low level communication utility for greenlets.
method
src.gevent._waiter.Waiter.throw(*throw_args)Switch to the greenlet with the exception.
class
src.gevent.backdoor.BackdoorServerProvide a backdoor to a program for debugging purposes.
method
src.gevent.backdoor.BackdoorServer.handle(conn, _address)Interact with one remote user.
method
src.gevent.baseserver.BaseServer.start()Start accepting the connections.
class
src.gevent.contextvars.ContextImplementation of :class:`contextvars.Context`
method
src.gevent.contextvars.Context.copy()Return a shallow copy.
class
src.gevent.contextvars.ContextVarImplementation of :class:`contextvars.ContextVar`.
class
src.gevent.contextvars.TokenOpaque implementation of :class:`contextvars.Token`.
class
src.gevent.event.AsyncResultA one-time event that stores a value or an exception.
method
src.gevent.event.AsyncResult.wait(timeout=None)Block until the instance is ready.
method
src.gevent.event.Event.clear()Reset the internal flag to false.
method
src.gevent.event.Event.set()Set the internal flag to true.
class
src.gevent.events.EventLoopBlockedThe event emitted when the event loop is blocked.
class
src.gevent.events.GeventDidPatchAllEventImplementation of `IGeventDidPatchAllEvent`.
class
src.gevent.events.GeventDidPatchBuiltinModulesEventImplementation of `IGeventDidPatchBuiltinModulesEvent`.
class
src.gevent.events.GeventDidPatchEventImplementation of `IGeventDidPatchEvent`.
class
src.gevent.events.GeventDidPatchModuleEventImplementation of `IGeventDidPatchModuleEvent`.
class
src.gevent.events.GeventPatchEventImplementation of `IGeventPatchEvent`.
class
src.gevent.events.GeventWillPatchAllEventImplementation of `IGeventWillPatchAllEvent`.
class
src.gevent.events.GeventWillPatchEventImplementation of `IGeventWillPatchEvent`.
class
src.gevent.events.GeventWillPatchModuleEventImplementation of `IGeventWillPatchModuleEvent`.
class
src.gevent.events.IEventLoopBlockedThe event emitted when the event loop is blocked.
class
src.gevent.events.IGeventDidPatchEventAn event emitted *after* gevent has patched something.
class
src.gevent.events.IGeventPatchEventThe root for all monkey-patch events gevent emits.
class
src.gevent.events.IGeventWillPatchEventAn event emitted *before* gevent monkey-patches something.
class
src.gevent.events.MemoryUsageThresholdExceededImplementation of `IMemoryUsageThresholdExceeded`.
class
src.gevent.events.MemoryUsageUnderThresholdImplementation of `IMemoryUsageUnderThreshold`.
class
src.gevent.greenlet.GreenletA light-weight cooperatively-scheduled execution unit.
method
src.gevent.greenlet.Greenlet.name()The greenlet name.
method
src.gevent.greenlet.Greenlet.unlink_all()Remove all the callbacks.
class
src.gevent.greenlet.SpawnedLinkA wrapper around link that calls it in another greenlet.
class
src.gevent.hub.HubA greenlet that runs the event loop.
method
src.gevent.hub.Hub.join(timeout=None)Wait for the event loop to finish.
method
src.gevent.hub.Hub.main_hub()Is this the hub for the main thread?
method
src.gevent.hub.Hub.run()Entry-point to running the loop.
func
src.gevent.hub.kill(greenlet, exception=GreenletExit)Kill greenlet asynchronously.
class
src.gevent.local.localAn object whose attributes are greenlet-local.
class
src.gevent.lock.RLockA mutex that can be acquired more than once by the same greenlet.
method
src.gevent.lock.RLock.release()Release the mutex.
class
src.gevent.monkey._errors.MonkeyPatchWarningThe type of warnings we issue.
func
src.gevent.monkey.patch_queue()Patch objects in :mod:`queue`.
func
src.gevent.os.close(fd)Close a file descriptor.
func
src.gevent.os.waitpid(pid, options)Wait for a child process to finish.
method
src.gevent.pool.Group.add(greenlet)Begin tracking the *greenlet*.
method
src.gevent.pool.Group.discard(greenlet)Stop tracking the greenlet.
class
src.gevent.pywsgi.EnvironA base class that can be used for WSGI environment objects.
class
src.gevent.queue.ChannelA queue-like object that can only hold one item at a time.
class
src.gevent.queue.ShutDowngevent extension for Python versions less than 3.13
class
src.gevent.queue.SimpleQueueCreate a queue object with a given maximum size.
method
src.gevent.queue.SimpleQueue.put(item, block=True, timeout=None)Put an item into the queue.
method
src.gevent.queue.SimpleQueue.qsize()Return the size of the queue.
method
src.gevent.resolver.AbstractResolver.close()Release resources held by this object.
class
src.gevent.resolver._hostsfile.HostsFileA class to read the contents of a hosts file (/etc/hosts).
class
src.gevent.resolver.dnspython.ResolverAn *experimental* resolver that uses `dnspython`_.
class
src.gevent.selectors.GeventSelectorA selector implementation using gevent primitives.
method
src.gevent.selectors.GeventSelector.select(timeout=None)Poll for I/O.
class
src.gevent.server.DatagramServerA UDP server
class
src.gevent.server.StreamServerA generic TCP server.
class
src.gevent.subprocess.CompletedProcessA process that has finished running.
method
src.gevent.subprocess.Popen.kill()Kill the process with SIGKILL
method
src.gevent.subprocess.Popen.pipe_cloexec()Create a pipe with FDs set CLOEXEC.
method
src.gevent.subprocess.Popen.poll()Check if child process has terminated.
method
src.gevent.subprocess.Popen.send_signal(sig)Send a signal to the process
method
src.gevent.subprocess.Popen.terminate()Terminates the process
class
src.gevent.thread.LockTypeThe basic lock type.
class
src.gevent.threadpool.ThreadPoolA pool of native worker threads.
class
src.gevent.threadpool.ThreadResultA one-time event for cross-thread communication.
method
src.gevent.timeout.Timeout.cancel()If the timeout is pending, cancel it.
method
src.gevent.timeout.Timeout.close()Close the timeout and free resources.
method
src.gevent.timeout.Timeout.start()Schedule the timeout.
class
src.gevent.util.GreenletTreeRepresents a tree of greenlets.
About this data
These signatures were extracted from the public source of gevent/gevent
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.