Request – request base classes

class uv.Request[source]

Requests represent (typically) short-lived operations. These operations can be performed over a handle: write requests are used to write data on a handle; or standalone: getaddrinfo requests don’t need a handle they run directly on the loop. This is the abstract base class of all internal libuv and pure Python requests.

cancel()[source]

Cancel a pending request. Fails if the request is executing or has finished executing.

class uv.UVRequest(loop, arguments, uv_handle=None, request_init=None)[source]

The base class of all libuv based requests.

Raises:

uv.LoopClosedError – loop has already been closed

Parameters:
  • loop (Loop) – loop where the request should run on
  • arguments (tuple) – arguments passed to the libuv request initializer
  • uv_handle (ffi.CData) – libuv handle the requests belongs to
  • request_init (callable) – libuv function for request initialization
loop

Loop where the request is running on.

Readonly:True
Type:Loop
finished

Request has been finished.

Readonly:True
Type:bool
type

Type of the request. Returns a subclass of uv.UVRequest.

Type:type
cancel()[source]
Raises:uv.UVError – error while canceling request
set_pending()[source]

Warning

This method is only for internal purposes and is not part of the official API.

clear_pending()[source]

Warning

This method is only for internal purposes and is not part of the official API.