Handle — Handle base class

class pyuv.Handle

Handle is an internal base class from which all handles inherit in pyuv. It provides all handles with a number of methods which are common for all.


Reference/unreference this handle. If running the event loop in default mode (UV_RUN_DEFAULT) the loop will exit when there are no more ref’d active handles left. Calling ref on a handle will ensure that the loop is maintained alive while the handle is active. Likewise, if all handles are unref’d, the loop would finish enven if they were all active.

This operations are idempotent, that is, you can call it multiple times with no difference in their effect.

Parameters:callback (callable) – Function that will be called after the handle is closed.

Close the handle. After a handle has been closed no other operations can be performed on it, they will raise HandleClosedError.

Callback signature: callback(handle)


Read only

Loop object where this handle runs.


Read only

Indicates if this handle is active.


Read only

Indicates if this handle is closing or already closed.

Previous topic

Loop — Event loop

Next topic

Timer — Timer handle

This Page