Idle – idle handle

class uv.Idle(loop=None, on_idle=None)[source]

Idle handles will run the given callback once per loop iteration, right before the uv.Prepare handles.

The notable difference with prepare handles is, that when there are active idle handles, the loop will perform a zero timeout poll instead of blocking for IO.

on_idle

Callback which should run right before the prepare handles.

on_idle(idle)
Parameters:idle (uv.Idle) – handle the call originates from
Readonly:False
Type:Callable[[uv.Idle], None]
start(on_idle=None)[source]

Start the handle. The callback will run once per loop iteration right before the prepare handles from now on.

Raises:
  • uv.UVError – error while starting the handle
  • uv.HandleClosedError – handle has already been closed or is closing
Parameters:

on_idle (Callable[[uv.Idle], None]) – callback which should run right before the prepare handles (overrides the current callback if specified)

stop()[source]

Stop the handle. The callback will no longer be called.

Raises:uv.UVError – error while stopping the handle